Skip to content
View mblen.php
#!/usr/bin/env php
<?php
mb_internal_encoding('UTF-8');
$string = '';
while( $line = fgets(STDIN) ) {
$string .= $line;
}
View cp-branch
#!/bin/zsh
set -e
if [ $# -lt 3 ]
then
echo "Not Enough Arguments"
return 1
fi
View fast-patch.php
#!/usr/bin/env php
<?php
if( count($argv) < 3 ) {
echo "Requires at least two arguments\n";
die(1);
}
$dir = realpath($argv[1]);
if( !is_dir($dir) ) {
View http.go
package utils
import (
"encoding/base64"
"net/http"
"strings"
)
func BasicAuth(handler http.HandlerFunc, username, password string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
View branch-be-gone.php
#!/usr/bin/env php
<?php
`git fetch -p --all`;
$branches = `git branch -vv`;
preg_match_all('%^\ +(?P<branch>[\w/=\-.#]+)\ +(?P<hash>[0-9a-fA-F]+)\ \[[\w/=\-.#]+:\sgone\]%smx', $branches, $result, PREG_PATTERN_ORDER);
foreach( $result['branch'] as $index => $branch ) {
$output = [ ];
View QuerySampler.php
<?php
$timeout = 1800; //seconds
$sleep = 100000; //microseconds
$start = time();
$link = mysql_connect('[[HOST]]', '[[USERNAME]]', '[[PASSWORD]]');
if( !$link ) {
die('Could not connect: ' . mysql_error());
}
View join2insert.php
#!/usr/bin/env php
<?php
$string = "";
$opt = getopt('r');
while( $line = fgets(STDIN) ) {
$string .= $line;
}
View ordmaker.php
#! /usr/bin/env php
<?php
$data = $argv[1];
$split = str_split($data);
foreach($split as $ord) {
echo "\\x" . dechex(ord($ord));
}
View arrays_are_similar.php
<?php
function arrays_are_similar( $aSide, $bSide ) {
$keys = array_unique(array_merge(
array_keys($aSide),
array_keys($bSide)
));
foreach( $keys as $key ) {
View _ScaledSpriteMap.scss
@mixin scaled-sprite-background($name, $scale, $spritemap) {
background: $spritemap;
$spritePath: sprite-path($spritemap);
@include background-size(image-width($spritePath) * $scale);
$position: sprite-position($spritemap, $name);
background-position: (nth($position, 1) * $scale) (nth($position, 2) * $scale);
height: image-height(sprite-file($spritemap, $name)) * $scale;
Something went wrong with that request. Please try again.