Skip to content

Instantly share code, notes, and snippets.

View toadkicker's full-sized avatar
🏠
Let's fix some stuff

Todd Baur toadkicker

🏠
Let's fix some stuff
View GitHub Profile
@wycks
wycks / htaccess cache and stuff
Last active March 26, 2022 20:48
Boilerplate .htaccess from Paul Irish with WordPress added
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@ttscoff
ttscoff / rtftomarkdown.rb
Created October 9, 2012 21:05
Convert RTF/DOC files to Markdown via Textutil
#!/usr/bin/ruby
=begin
Usage: rtftomarkdown.rb FILENAME.rtf
Uses textutil, available on Mac only (installed by default)
Outputs to STDOUT
Notes:
Links are replaced with Markdown references (duplicate links combined).
@keighl
keighl / NSString+Extras.m
Created December 19, 2012 13:37
Secure API Request From iOS to Rails
#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>
#import <CommonCrypto/CommonHMAC.h>
@interface NSString (Extras)
+ (NSString *)authSignatureWithToken:(NSString *)token;
@end
@implementation NSString (Extras)
@n1k0
n1k0 / 404checker.js
Created January 11, 2013 10:55
A CasperJS script to check for 404 & 500 internal links on a given website
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
@hbrandl
hbrandl / RailsFlashToHeaders.md
Last active November 2, 2023 11:57 — forked from linjunpop/README.md
Rails flash messages with AJAX requests & twitter-bootstrap
@Munter
Munter / example.server.config
Created May 16, 2013 08:42
Nginx example setup for a single page web application with far future expires static content in /static/ and proxying to several backends on any other request that /static or /.
upstream backends {
ip_hash;
server 0.0.0.0:80;
server 0.0.0.0:80;
}
server {
server_name app.falconsocial.com;
@johanfriis
johanfriis / titleize.js
Created May 18, 2013 20:10
Convert a string to a human readable title string #snippet
/*
* Convert a string into a human readable title
*
* This function borrows heavily from sugar.js
* http://sugarjs.com/
*
* titleize("man from the boondocks") -> Man from the Boondocks
* titleize("x-men: the last stand") -> X Men: The Last Stand
* titleize("TheManWithoutAPast") -> The Man Without a Past
* titleize("raiders_of_the_lost_ark") -> Raiders of the Lost Ark
@jdowning
jdowning / ami-clean.sh
Last active December 26, 2023 20:09
Script to clean up Ubuntu EC2 instance before packaging as an AMI
#!/bin/bash
# This script cleans up your EC2 instance before baking a new AMI.
# Run the following command in a root shell:
#
# bash <(curl -s https://gist.github.com/justindowning/5921369/raw/ami-clean.sh)
function print_green {
echo -e "\e[32m${1}\e[0m"
}
@k98kurz
k98kurz / fixfacebook.tamperscript.js
Last active December 19, 2015 22:19
Basically, this takes the annoying graph search bar and fixes it: it takes up less space on the top of the screen, moves the notifications back to the left side of the page (where they belong), and nudges upward the drop-down thing on profile pages. Pretty self-explanatory.
// ==UserScript==
// @name Facebook fix
// @namespace https://gist.github.com/k98kurz
// @updateURL https://gist.githubusercontent.com/k98kurz/6026739/raw
// @version 1.2.1
// @description blah
// @match https://*.facebook.com/*
// @copyright 2014+, k98kurz
// ==/UserScript==
@ricardobeat
ricardobeat / serialize-multipart.js
Created September 20, 2013 04:28
JSON serialize to multipart form data
function serializeMultipart (obj, previous) {
var pairs = []
_.each(obj, function (value, key) {
if (previous !== undefined) {
key = previous + '[' + key + ']'
}
if (_.isArray(value)) {
_.each(value, function (value) {
pairs.push([key + '[]', value])