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
/* Exercise: Loops and Functions #43 */ | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(2.) |
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
Show hidden characters
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |
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
Authenticate with GitHub to increase your rate limit and allow you | |
to pull from private repositories. To do that, add the following | |
entry to your ~/.netrc file: | |
machine api.github.com | |
login <username> | |
password <token> |
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 | |
echo "Hello from VIM"; |
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 | |
function deployer_autoload($name) { | |
$libDirs = array( | |
'./deployer/lib/deployer/', | |
'./lib/deployer/', | |
); | |
foreach ($libDirs as $libDir){ | |
if(strpos($name, '_')>0) { | |
$filePath = $libDir . str_replace('_','/',$name).'.php'; |
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
map <F11> :wall<CR>:!svn commit -m 'changes' %<CR> |
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
#!/usr/bin/env php | |
<?php | |
function data_uri($file, $mime) | |
{ | |
$contents = file_get_contents($file); | |
$base64 = base64_encode($contents); | |
return ('data:' . $mime . ';base64,' . $base64); | |
} | |
$url = $mime = false; |
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! Img2Data() | |
python << EOF | |
import vim, urllib2, base64, mimetypes | |
from urlparse import urlparse | |
try: | |
url = vim.eval('@+') | |
o = urlparse(url) | |
file_type = mimetypes.guess_type(url)[0] |
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 | |
if( '20110204024217300000' == '20110204024217300264' ) | |
echo 'equal'; | |
else | |
echo 'not equal'; |
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 | |
class dog { | |
public $name = ''; | |
public function setName($name) { | |
$this->name = $name; | |
} | |
public function getName() { | |
return $this->name; |
OlderNewer