Instantly share code, notes, and snippets.

View headersof.sh
#!/usr/bin/env bash
curl -s -D - "$1" -o /dev/null
View code-coverage-daylight.css
/**
* PHPUnit Code Coverage Daylight Style
* Makes coverage pages more readable
*/
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro');
body {
padding-top: 10px;
background: #f1f1f1;
View fonts.scss
@font-face {
font-family: "Whitney SSm SC A";
src: url(data:application/x-font-woff;base64,d09GRk9UVE8AACSFAA0AAAAAN7gAAQAAAAAiXAAAAikAAAaRAAAAAAAAAABDRkYgAAAIzAAAFOgAABjhSw4xdkdERUYAAB20AAAAHQAAACAApQAER1BPUwAAHdQAAALQAAALHqpjoC9HU1VCAAAgpAAAAFoAAACA6dotXU9TLzIAAAGMAAAATwAAAGBZHFc/Y21hcAAABmgAAAJOAAADoIQ7xnlnYXNwAAAhAAAAAAgAAAAIAAAAC2hlYWQAAAEwAAAANAAAADYC7N5yaGhlYQAAAWQAAAAgAAAAJAd+A49obXR4AAAhCAAAAVMAAAHg/fogQW1heHAAAAGEAAAABgAAAAYAeFAAbmFtZQAAAdwAAASKAAALyqV9lZxwb3N0AAAIuAAAABMAAAAg/7gAMnjaY2BkYGBgZHC8dFVtYTy/zVcGbuYXQBGGC5y+JTD6/9X/KszPmB2AXA4GJpAoAGwsDKh42mNgZGBgPvBfgIGBRf//1f/XmZ8xAEVQQAUAoQcHEwAAUAAAeAAAeNpjYGKSYXRlYGVgYdrD1MXAwNADoRnvMhgx/GJAAgsZmP47MDBEw/geas75QEpZUYlZ4b8FwwnmAwwfgPz5IDkmIaarDApAyAQAvV8O/gB42rVUTW/bRhAdWXJsJ7ET+5jTNA2MpJBkyVBiK6eiBgznGhsJAvRQilqJdEQusVxaYZFD7+2xhx7yO3ruD+hP6I/p2+G6puJEcYFWhLhvZ+fjvZkFiehR43dqUPX7Fv8KN+hr7Cq8QmsUetykr+jc41bNZ5U26WePb+HkN4/XaEIfPF6nzcaKxxs1fHtlu3HP4zu002SP79bwZs1ni75p7nt8v8Zhu4Z3BDep0drA7qfm9x436Lj5l8crtNV66HGTvmv1PG7VfFbpQct4fIvWW794vEZ/tn71e
View gist:ff8b7fa3dccb8b85b1bdc1af40de8fec
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version
View runlocal.sh
#!/usr/bin/env bash
###########################################################################################
# runlocal - Build & run a local environment using docker (alternative to eb local run) #
# Also cleans up containers and images built; #
# #
# usage: runlocal <path> [options...] #
# #
# @author: adrian7 <adrian.silimon.eu> #
# @version: 1.1 #
View requestbin.php
<?php
/**
* RequestBin - Captures and displays HTTP requests
* @author adrian7
* @version 1.1
*/
//TODO (1) Parse request data in a nice way
//TODO (2) Alternative nice display alongside raw
View singleton.js
var Singleton = (function() {
var random = ( "My Private Random Int = " + parseInt(1000 * Math.random()) );
var privateVar = "My Private Variable";
function privateMethod () {
return ( "My privateMethod()\n" + privateVar );
}
View 26-time-management-hacks.md

26 time management hacks I wish I'd known at 20

  1. There's always time. Time is priorities
  2. Days always fill up | "Only plan for 4-5 hours of real work per day."
  3. Work more when you're in the zone. Relax when you're not. | "It's normal to have days where you just can't work and days where you'll work 12 hours straight"
  4. Respect your time and make it respected | "Your time is $1000/hour, and you need to act accordingly"
  5. Stop multi-tasking. It merely kills your focus.
  6. Set up a work routine and stick to it. Your body will adapt
  7. We're always more focused and productive with limited time.
  8. Work is the best way to get working. Start with short tasks to get the ball rolling.
View php-transfer-vars.sh
### Append Container variables to PHP-FPM pool configuration ###
PHP5_CONFIG_FILE=/etc/php5/fpm/pool.d/www.conf
echo "" >> $PHP5_CONFIG_FILE;
echo ";container environment variables" >> $PHP5_CONFIG_FILE;
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
View .bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (git \1)/'
}
export PS1="\\n\D{%F %T} \[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h \[\033[33;1m\]\w\[\033[m\] \$(parse_git_branch)\n\$ "
export CLICOLOR=1
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}\007"'