//this is a commit!!
trans.Commit();

It doesn't look like it was there because of some changes - someone simply wanted to be double sure he will see the commit there, I guess..

By Vukko, 2016-10-03 15:20:49
function focused(evt, errors) {
	let form = evt.target

	const output = errors.map((error)=> {

		// Find first component with error on form and set focus to it

		let focusedInput = (Object.keys(error) == "phonebookId") ? Object.keys(error) :
			(Object.keys(error) == "phonebook_str") ? Object.keys(error) :
				(Object.keys(error) == "message") ? Object.keys(error) :
					(Object.keys(error) == "image") ? Object.keys(error) :
						(Object.keys(error) == "buttonLink") ? Object.keys(error) :
							(Object.keys(error) == "messageSms") ? Object.keys(error) : false
		return focusedInput.shift()
	})

	const selector = output.shift()
	form.querySelector('[id="' + selector + '"]').focus()

	return selector
}

What can I say... If you plan to work with freelancers with low rate then you should be ready to find it in them code :)

By Ya, 2016-10-02 12:16:46
$_POST = $this->db->mres($_POST);
$_SESSION['post'] = $_POST;

$sql = "SELECT id, documento, nombre1, nombre2, apellido1, apellido2 "
        . "FROM usuarios "
        . "WHERE " .
    "REPLACE(" .
        "REPLACE(" .
            "REPLACE(" .
                "REPLACE(telefono,' ','')," .
                "'(','')," .
            "')','')," .
        "'-','') LIKE '%{$searchTel}'";
By Carlos Correa, 2016-09-16 22:11:38
.toolbar-menu-tabs > * {
    border-left: 1px solid #f0f0f0;
}

.toolbar-menu-tabs > * + * {
    /* a lot of stuff here */
}
By Anonymous, 2016-07-28 15:58:05
private void reset_kolejnosc()
{
	this.kolejnosc_s[0] = 1;
	this.kolejnosc_s[1] = 2;
	this.kolejnosc_s[2] = 3;
	this.kolejnosc_s[3] = 4;
	this.kolejnosc_s[4] = 5;
	this.kolejnosc_s[5] = 6;
	this.kolejnosc_s[6] = 7;
	this.kolejnosc_s[7] = 8;
	this.kolejnosc_s[8] = 9;
	this.kolejnosc_s[9] = 10;
}
By winek, 2016-07-17 00:16:00
#64 :) PHP +182
        if ($act_number)
        {
        	$act_number = $act_number;
        }
        else
        {
        	throw new Exception("Документ еще не подготовлен.");
        }
By wata5h1, 2016-07-07 17:09:32
> const today = new Date(2016, 7, 7)
undefined
> const tomorrow = new Date(2016, 7, 8)
undefined
> tomorrow >= today
true
> today <= tomorrow
true
> today == tomorrow
false
By winek, 2016-05-30 16:08:25
#62 C# +296
protected Int32 Sum(int one, int two)
{
    int result;
    int tmp;
    
    tmp = one + two;
    result = tmp;
    return result;
}

Jesus.

By Anonymous, 2016-05-29 17:19:14
if HOST == 'AdaLovelace' or HOST == 'vbu' or HOST == 'asus':
    urlpatterns += patterns('',
        (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': MEDIA_ROOT}),
    )
By Kadet, 2016-02-14 16:37:32
var query = $("#search-query");
query.click(function() {
  if (query.val() == 'szukaj...') {
     query.val('');
  }
});
By Kadet, 2016-02-14 14:54:32
#59 PHP +34
function mysql_escape_string($str) {
    
    $pattern = [
        '/\x00/',
        '/\n/',
        '/\r/',
        '/\//',
        "/'/",
        '/"/',
        '/\x1a/',
    ];
    
    $replacement = [
        '\\x00',
        '\\n',
        '\\r',
        '\\',
        "\'",
        '\"',
        '\\x1a',
    ];
    
    $res = preg_replace($pattern, $replacement, $str);
    return $res;
}
By Anonymous, 2016-02-13 18:22:55
$("#search-submit").click(function() {
  $("#search form").submit()
});

type="submit" is too mainstream, jquery is the proper way to do it

By Kadet, 2016-02-13 16:44:10
 foreach (Byte bajt in data ) {
                    BufferIndex = i++;
                    if (!char.IsControl((char)bajt))
                        MyCharacter = Convert.ToChar(bajt).ToString();//Encoding.ASCII.GetString(new[]{bajt});
                    else
                        MyCharacter = " ";

                    if (BufferIndex == 200)
                        {
                            int a = BufferIndex;
                        }

                    
                    if (BufferIndex < 200)
                    {
                        sw.WriteLine("PrintBuffer1[" + BufferIndex + "] :=\t" + bajt + "\t; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "\t" + MyCharacter );
                    }

                    if (BufferIndex >= 200 && BufferIndex  < 400)
                    {
                        BufferIndex = BufferIndex - 200;
                        sw.WriteLine("PrintBuffer2[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 400 && BufferIndex < 600)
                    {
                        BufferIndex = BufferIndex - 400;
                        sw.WriteLine("PrintBuffer3[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 600 && BufferIndex < 800)
                    {
                        BufferIndex = BufferIndex - 600;
                        sw.WriteLine("PrintBuffer4[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 800 && BufferIndex < 1000)
                    {
                        BufferIndex = BufferIndex - 800;
                        sw.WriteLine("PrintBuffer5[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1000 && BufferIndex < 1200)
                    {
                        BufferIndex = BufferIndex - 1000;
                        sw.WriteLine("PrintBuffer6[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1200 && BufferIndex < 1400)
                    {
	                        BufferIndex = BufferIndex - 1200;
                        sw.WriteLine("PrintBuffer7[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1400 && BufferIndex < 1600)
                    {
                        BufferIndex = BufferIndex - 1400;
                        sw.WriteLine("PrintBuffer8[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1600 && BufferIndex < 1800)
                    {
                        BufferIndex = BufferIndex - 1600;
                        sw.WriteLine("PrintBuffer9[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1800 && BufferIndex < 2000)
                    {
                        BufferIndex = BufferIndex - 1800;
                        sw.WriteLine("PrintBuffer10[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 2000 && BufferIndex < 2200)
                    {
                        BufferIndex = BufferIndex - 2000;
                        sw.WriteLine("PrintBuffer11[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 2200 && BufferIndex < 2400)
                    {
                        BufferIndex = BufferIndex - 2200;
                        sw.WriteLine("PrintBuffer12[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }

                        
                }

don't repeat yourself.. whyy we don't have PrintBufeer[i] ?

By Anonymous, 2016-02-08 09:52:40
Native XML structure:

<?xml version="1.0" encoding="utf-8" ?>
<tree>
    <node name="root">
        <node name="TELEVISIONS">
            <node name="TUBE"/>
            <node name="LCD"/>
            <node name="PLASMA"/>
        </node>
        <node name="PORTABLE ELECTRONICS">
            <node name="MP3 PLAYERS">
                <node name="FLASH"/>
            </node>
            <node name="CD PLAYERS"/>
            <node name="2 WAY RADIOS"/>
        </node>
    </node>
</tree>

Flattened XML structure (example 1):

<tree>
  <node key="0">root</node>
  <node key="1" parent="0">TELEVISIONS</node>
  <node key="2" parent="1">TUBE</node>
  <node key="3" parent="1">LCD</node>
  <node key="4" parent="1">PLASMA</node>
  <node key="5" parent="0">PORTABLE ELECTRONICS</node>
  <node key="6" parent="5">MP3 PLAYERS</node>
  <node key="7" parent="6">FLASH</node>
  <node key="8" parent="5">CD PLAYERS</node>
  <node key="9" parent="5">2 WAY RADIOS</node>
</tree>

Flattened XML structure (example 2):

<tree>
    <node>
        <name>root</name>
        <depth>0</depth>
    </node>
    <node>
        <name>TELEVISIONS</name>
        <depth>1</depth>
    </node>
    <node>
        <name>TUBE</name>
        <depth>2</depth>
    </node>
    <node>
        <name>LCD</name>
        <depth>2</depth>
    </node>
    <node>
        <name>PLASMA</name>
        <depth>2</depth>
    </node>
    <node>
        <name>PORTABLE ELECTRONICS</name>
        <depth>1</depth>
    </node>
    <node>
        <name>MP3 PLAYERS</name>
        <depth>2</depth>
    </node>
    <node>
        <name>FLASH</name>
        <depth>3</depth>
    </node>
    <node>
        <name>CD PLAYERS</name>
        <depth>2</depth>
    </node>
    <node>
        <name>2 WAY RADIOS</name>
        <depth>2</depth>
    </node>
</tree>
By Anonymous, 2015-11-19 12:32:25
> var x = 3;
> '5' + x - x
50
> '5' - x + x
5 // Because fuck math

JS is simply. Oh, wait...

By mademan, 2015-11-18 13:50:39