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 | |
/** | |
* Calculate entropy of a string | |
* | |
* @see https://github.com/jreesuk/entropizer | |
* | |
* @param string $str | |
* @return integer | |
*/ | |
function entropizer($str) { |
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
git ls-tree --name-only -z -r HEAD |\ | |
grep -zZP '^(?!(lib|tmp|fonts|app/helper/(diff|textile))/)(?!(css|less|js)/(bootstrap|jquery|chart|respond|modernizr|datepicker|simplemde|intercom|stupidtable|typeahead|bootswatch)).*\.(php|css|less|js|html)$' |\ | |
xargs -0 -n1 git blame --line-porcelain |\ | |
grep \"^author \" | sort | uniq -c | sort -nr |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>iOS 5</title> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
font-family: 'Helvetica Neue', Arial, sans-serif; | |
background-image: url("data:image/gif;base64,R0lGODlhCgAKAIABAN3d3f///yH5BAEKAAEALAAAAAAKAAoAAAIRjA2Zhwoc3GMSykqd1VltzxQAOw=="); | |
background-repeat: repeat; |
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
#!/bin/bash | |
mkdir -p mediterranean-gtk-themes/usr/share/ && cd $_ | |
git clone --depth=1 https://github.com/rbrito/mediterranean-gtk-themes.git themes | |
cd themes | |
VER=$(git rev-parse --short=12 HEAD) | |
rm -rf .git | |
rm LICENSE README.md | |
cd ../../.. | |
mkdir DEBIAN | |
cat >DEBIAN/control <<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
#!/bin/bash | |
PROJPATH="/var/www/phproject" | |
cd $PROJPATH | |
/usr/bin/git pull | |
cd $PROJPATH/app/plugin | |
for i in */; do | |
echo "Updating $i ..." | |
cd $i |
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 | |
/** | |
* Get terminal window size in characters | |
* @return array | |
*/ | |
function getWindowSize() { | |
return array(exec('tput cols'), exec('tput lines')); | |
} |
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 bigformat($n) { | |
// Start with a Googol and work down | |
if($n>pow(10,100)) | |
return round(($n/pow(10,100)),1).' googol'; | |
// I'll add more later | |
if($n>pow(1000,32)) | |
return round(($n/pow(1000,32)),1).' untrigintillion'; | |
if($n>pow(1000,31)) | |
return round(($n/pow(1000,31)),1).' trigintillion'; |
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
#!/bin/bash | |
function prompt() { | |
echo -n $1 | |
echo -n " [y/n] " | |
read prompt_response | |
if [ $prompt_response == 'y' ]; then | |
return 0 | |
else | |
return 1 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# I have issues with OS X's defaults. Luckily, most are easy to change. | |
# This is heavily based on saetia's gist: https://gist.github.com/saetia/1623487 | |
# Disable autocomplete, which effectively disables that really stupid Escape key autocomplete handler | |
defaults write -g NSUseSpellCheckerForCompletions -bool false | |
# Disable window animations | |
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false | |
# Expand save panel by default |