this is ** bold ** text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shuffle(a) { | |
var j, x, i; | |
for (i = a.length - 1; i > 0; i--) { | |
j = Math.floor(Math.random() * (i + 1)); | |
x = a[i]; | |
a[i] = a[j]; | |
a[j] = x; | |
} | |
return a; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$unit = ['b','kb','mb','gb','tb','pb']; | |
$size = memory_get_peak_usage(true); | |
$usage = @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i]; | |
echo $usage . PHP_EOL; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Why do we refactor? | |
- We refactor to both clean up our code and make it more readable, as well as making it more modular. | |
2. What's the difference between "refactoring" and "changing shit"? | |
- Refactoring has a specific goal. | |
3. What role do patterns play in refactoring? | |
- There are certain observable patterns that can clue us in to places that may need refactoring. | |
4. Why do some refactoring patterns seem to be opposites? | |
- Because there are different patterns and refactoring methods for different situations. | |
5. Does refactoring always make code better? | |
- As long as it is done in a predictable and consistent manner. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul { | |
margin : 0; | |
padding : 0; | |
list-style-type : none; | |
} | |
li { | |
background : rgba(40,255,91,.15); | |
} | |
.columns { | |
-webkit-column-count : 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function encrypt( $plaintext ) | |
{ | |
$iv = mcrypt_create_iv( $this->iv_size, MCRYPT_RAND ); | |
$encrypted = mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $this->key, $plaintext, MCRYPT_MODE_CBC, $iv ); | |
return base64_encode( $iv . $encrypted ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"font_face": "TheSansMono", | |
"font_size": 14, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"line_padding_bottom": 2, | |
"line_padding_top": 2, | |
"soda_classic_tabs": true, | |
"soda_folder_icons": true, |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- these are the only values you need to set | |
-- and then just run these in squence from the mysql terminal | |
-- | |
SET @USER := 'Your User Name'; | |
SET @EMAIL := '[email protected]'; | |
SET @PASS := 'your-password-here'; | |
-- | |
-- wordpress will 'upgrade' the MD5 on your first login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This SQL implements the Double Metaphone algorythm (c) 1998, 1999 by Lawrence Philips | |
-- it was translated to Python, and then to SQL from the C source written by Kevin Atkinson (http://aspell.net/metaphone/) | |
-- By Andrew Collins - Feb, 2007 who claims no rights to this work | |
-- http://www.atomodo.com/code/double-metaphone/metaphone.sql/view | |
-- Tested with MySQL 5.1 on Ubuntu 6.01 and Ubuntu 10.4 | |
-- Updated Nov 27, 2007 to fix a bug in the 'CC' section | |
-- Updated Jun 01, 2010 to fix a bug in the 'Z' section - thanks Nils Johnsson! | |
-- Updated Jun 25, 2010 to fix 16 signifigant bugs - thanks again Nils Johnsson for a spectacular | |
-- bug squashing effort. There were many cases where this function wouldn't give the same output | |
-- as the original C source that were fixed by his careful attention and excellent communication. |
NewerOlder