Skip to content

Instantly share code, notes, and snippets.

View exu's full-sized avatar
🔨
forging testkube

Jacek Wysocki exu

🔨
forging testkube
View GitHub Profile
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@exu
exu / .jshintrc
Last active August 29, 2015 13:56 — forked from haschek/.jshintrc
{
// --------------------------------------------------------------------
// 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
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>
<?php
echo "Hello from VIM";
<?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';
map <F11> :wall<CR>:!svn commit -m 'changes' %<CR>
@exu
exu / image_to_data.php
Created March 30, 2011 12:37
Image to inline data script
#!/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;
@exu
exu / img2data.vim
Created March 31, 2011 22:38
VIM plugin to convert images to embedded html data
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]
<?php
if( '20110204024217300000' == '20110204024217300264' )
echo 'equal';
else
echo 'not equal';
<?php
class dog {
public $name = '';
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;