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 bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# Forked by badcrocodile to check for changed files in a specified directory | |
# git hook to run a command after `git pull` if any files in a specified directory have been changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
/** | |
* Available GET parameters: | |
* | |
* == COLORS == | |
* bg_r - Red component of bar background color | |
* bg_g - Green component of bar background color | |
* bg_b - Blue component of bar background color | |
* from_r - Red component of gradient start |
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
/* first column */ | |
.one-third:nth-child(3n-2){ | |
margin-left: 0; | |
} | |
/* middle column */ | |
.one-third:nth-child(3n+2) { | |
padding:5px | |
} | |
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 | |
header("Content-type: image/png"); | |
$image = imagecreatefrompng("bubble3.png"); | |
$price = (int)$_GET['price']; | |
$font = 'arialbd.ttf'; | |
$fontsize = 8; | |
$color = imagecolorallocate($image,255,255,255); | |
$px_top = 16; | |
switch(true) { | |
case ($price > 0 && $price <= 5000): // $price returns 0 if string is passed |
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 | |
// (string) $message - message to be passed to Slack | |
// (string) $room - room in which to write the message, too | |
// (string) $icon - You can set up custom emoji icons to use with each message | |
public static function slack($message, $room = "engineering", $icon = ":longbox:") { | |
$room = ($room) ? $room : "engineering"; | |
$data = "payload=" . json_encode(array( | |
"channel" => "#{$room}", | |
"text" => $message, |
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
module.exports = function(grunt) { | |
require('time-grunt')(grunt); | |
require('load-grunt-config')(grunt, { | |
jitGrunt: true | |
}); | |
grunt.initConfig({ | |
less: { |
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
window.googletag = window.googletag || {}; | |
googletag.cmd = googletag.cmd || []; | |
googletag.cmd.push(detectAdLoad); | |
function detectAdLoad() { | |
/** | |
* NOTE: This function depends on the ad slot ID (var targetSlot). If this changes, this function will break | |
* | |
* Patched together using documentation at https://developers.google.com/doubleclick-gpt/reference |
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 interval(func, wait, times){ | |
var interv = function(w, t){ | |
return function(){ | |
if(typeof t === "undefined" || t-- > 0){ | |
setTimeout(interv, w); | |
try{ | |
func.call(null); | |
} | |
catch(e){ | |
t = 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 (is_user_logged_in()) { ?> | |
<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds. | |
<?php } ?> |