Skip to content

Instantly share code, notes, and snippets.

View jedfoster's full-sized avatar

Jed Foster jedfoster

View GitHub Profile
@tylerhall
tylerhall / strong-passwords.php
Created August 12, 2010 21:38
A user friendly, strong password generator PHP function.
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
@paulirish
paulirish / gist:526168
Created August 16, 2010 00:42 — forked from anonymous/>
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- According to Heather Champ, former community manager at flickr,
you should not allow search engines to index your "Contact Us"
@subtleGradient
subtleGradient / appify
Created November 11, 2010 16:03
appify. Create the simplest possible mac app from a shell script
#!/usr/bin/env bash
#
# url : https://gist.github.com/672684
# version : 2.0.2
# name : appify
# description : Create the simplest possible mac app from a shell script.
# usage : cat my-script.sh | appify MyApp
# platform : Mac OS X
# author : Thomas Aylott <oblivious@subtlegradient.com>
@Dirklectisch
Dirklectisch / git.plist
Created January 20, 2011 21:01
Property list used to launch a Git Daemon on Mac OS X
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UserName</key>
<string>git</string>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>git</string>
@markupboy
markupboy / html5video.sh
Created February 8, 2011 15:43
automated conversion of a file to all three html5 compatible video formats - h.264, ogg, and webm
#!/bin/sh
####################################
# Output file for HTML5 video #
# Requirements: #
# - handbrakecli #
# - ffmpeg #
# - ffmpeg2theora #
# #
# usage: #
@trekdemo
trekdemo / shell
Created February 16, 2011 10:56
Diff files selected in the TextMate drawer with Kaleidoscope
sudo ln -s /usr/local/bin/ksdiff /usr/bin/ksdiff
@courtsimas
courtsimas / gist:1167053
Created August 24, 2011 01:01
@import-once hack for sass
//sessions.css.scss - file #1 that i only want to let the _style.scss import be included once
$imported-once-files: ();
@function import-once($name) {
@if index($imported-once-files, $name) {
@return false;
}
$imported-once-files: append($imported-once-files, $name);
@return true;
@ivanoats
ivanoats / gist:1823034
Last active November 19, 2022 06:08 — forked from parndt/gist:958385
Setting up GIT Bash autocompletion. Use this only if you are using Bash instead of ZSH.
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@zachleat
zachleat / gist:2008932
Created March 9, 2012 21:56
Prevent zoom on focus
// * iOS zooms on form element focus. This script prevents that behavior.
// * <meta name="viewport" content="width=device-width,initial-scale=1">
// If you dynamically add a maximum-scale where no default exists,
// the value persists on the page even after removed from viewport.content.
// So if no maximum-scale is set, adds maximum-scale=10 on blur.
// If maximum-scale is set, reuses that original value.
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0">
// second maximum-scale declaration will take precedence.
// * Will respect original maximum-scale, if set.
// * Works with int or float scale values.