Skip to content

Instantly share code, notes, and snippets.

@jlindley
jlindley / pre-commit
Created November 11, 2010 22:50 — forked from jhsu/pre-commit
pre-commit hook for git, prevents console.log() statements
#!/bin/sh
# Don't allow console.log() statements to be committed.
#
# Add to .git/hooks/pre-commit
#
# Note: jquery.js seems to always include 1 reference
# in a debugging section, that one can be safely
# ignored. 1 reference to console.log is cool
@guilhermeblanco
guilhermeblanco / resize_animated_gif.php
Created February 11, 2011 02:51
With PECL Imagick extension and using PHP
<?php
$maxWidth = 200;
$maxHeight = 200;
try {
$imagick = new Imagick();
$fh = fopen(__DIR__ . '/batman.gif', 'r');
$imagick->readImageFile($fh);
@jperras
jperras / programmer_prayer.txt
Created April 18, 2011 20:41
The programmer's prayer.
Our root,
who art in Unix,
hallowed be thy shell.
Thy kernel come.
Thy commands be run
@localhost as they are in iNet.
Give us this day our daily updates,
And forgive us for our four-oh-threes,
as we forgive those who 403 against us.
And lead us not into segfaults,
@pandeiro
pandeiro / 0main.md
Created January 2, 2012 22:49 — forked from SethRobertson/index.md
Git Best Practices

Git Best Practices

This is a fairly common question, and there isn't a One True Answer, but still, this represents a consensus from #git

Read about git

Knowing where to look is half the battle. I strongly urge everyone to read (and support) the Pro Git book. The other resources are highly

@franz-josef-kaiser
franz-josef-kaiser / image-sizes-extd.php
Last active January 24, 2017 18:29
Altering & handling default and custom wordpress image sizes and related stuff
<?php
defined( 'ABSPATH' ) OR exit;
add_action( 'init', array( 'oxoImageSizesExtd', 'init' ), 0 );
class oxoImageSizesExtd extends oxoImageSizes
{
/**
* The Class Object
* @var
@sanxac
sanxac / scss2sass.sh
Created March 15, 2012 20:45
convert scss files to sass and delete .scss files in a directory
#!/bin/bash
for f in *.scss; do sass-convert $f ${f%scss}sass ; done
rm *.scss
@carlosmcevilly
carlosmcevilly / gist:2221249
Last active April 3, 2025 12:47
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@mackuba
mackuba / install.sh
Created April 26, 2012 15:46
Link all dotfiles from Dropbox
#!/bin/bash
for filename in `ls /Users/psionides/Dropbox/dotfiles`; do
name=`basename $filename .txt`
echo "Linking /Users/psionides/Dropbox/dotfiles/$filename to /Users/psionides/.$name..."
rm -f /Users/psionides/.$name
ln -s /Users/psionides/Dropbox/dotfiles/$filename /Users/psionides/.$name
done
echo "Done."
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})