Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
@cagatay
cagatay / app.yaml
Created October 18, 2011 19:14 — forked from darktable/app.yaml
App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be necessary
application: your-app-name
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@textarcana
textarcana / git-log2json.sh
Last active March 1, 2024 05:26
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@bigdawggi
bigdawggi / Outbound Link Tracking - Google Analytics.js
Created November 22, 2011 23:02
jQuery-based outbound link tracking with cases for new window as well as same window locations
@insin
insin / bash_prompt.sh
Created December 3, 2011 01:49 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@perusio
perusio / drupal_uid_header.module
Created December 27, 2011 07:31
Simple module to add a header with the user ID
<?php
/**
* @file drupal_uid_header.module
* @author António P. P. Almeida <appa@perusio.net>
* @date Tue Dec 27 2011
*
* @brief Sets an HTTP header with the UID (Drupal 6).
*
*/
@corruptmem
corruptmem / npm-packages.txt
Created December 29, 2011 01:55
NPM packages by "importance"
coffee-script 24019 [u'coffeescript', u'javascript', u'language', u'compiler']
socket.io 19498 [u'websocket', u'socket', u'realtime', u'cross-browser', u'apps', u'ajax', u'socket.io', u'api', u'easy', u'real-time', u'comet']
should 17605 [u'test', u'bdd', u'assert', u'framework']
expresso 16266 [u'tdd']
jade 15322 [u'engine', u'jade', u'template']
stylus 14328 [u'stylesheets', u'style', u'language', u'jade', u'parser', u'css']
mkdirp 13690 [u'directory', u'mkdir', u'like']
mime 13145 [u'util', u'mime', u'mapping', u'library']
underscore 11906 [u'helper', u'programming', u'functional', u'server', u'util', u'client', u'browser']
nodeunit 11571 [u'node.js', u'testing', u'unit', u'easy']
@nfreear
nfreear / iframe-blackout.drupal-block.html
Created January 19, 2012 10:32
Adding SOPA blackout to a Drupal Gardens - Javascript + Iframe - by Jacob Singh.name, Zachstronaut.
<script>
/*!
* Javascript-iframe (Drupal) SOPA-blackout solution.
*
* authors: Jacob Singh, Zachstronaut, Nick Freear, 2012-01-17.
* help: http://jacobsingh.name/content/adding-sopa-blackout-drupal-gardens
* via: http://drupal.org/planet
*/
(function blackout(){
var a = new Date,
@tpryan
tpryan / ribbon.html
Last active April 11, 2024 00:21
Github Ribbon in CSS.
<!--
Copyright (c) 2012 Terrence Ryan
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following
conditions:
@nfreear
nfreear / my-ajax-debug.drupal.php
Last active September 30, 2015 03:17
If a debug parameter variable is set, output PHP expressions in HTTP headers / Drupal.
<?php
<?php
ini_set( 'display_errors', 1);
error_reporting( E_ALL );
//header( 'Content-Type: text/plain');
function my_test() {
@maettig
maettig / LICENSE.txt
Created February 7, 2012 03:56 — forked from 140bytes/LICENSE.txt
encodeJavaScriptString in 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Thiemo Mättig <http://maettig.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE