Skip to content

Instantly share code, notes, and snippets.

@jgwhite
jgwhite / Gemfile
Created November 9, 2012 16:05
Testing Static HTML with RSpec & Capybara
source :rubygems
gem 'capybara'
gem 'rack'
gem 'rspec'
@naps62
naps62 / Gruntfile.coffee
Last active January 23, 2017 05:47
quick Grunt.js setup with Sass + Coffee + Slim
module.exports = (grunt) ->
# configuration
grunt.initConfig
# grunt sass
sass:
compile:
options:
style: 'expanded'
@clintconklin
clintconklin / gist:7393526
Last active February 6, 2017 15:12
Optimizing multiple files with grunt via grunt-contrib-requirejs: http://blog.clintconklin.com/optimizing-multiple-javascript-files-with-grunt-and-requirejs/
module.exports = function(grunt) {
var matches = grunt.file.expand('scripts/template-scripts/**/index.js');
var requirejsOptions = {};
if (matches.length > 0) {
for (var x = 0; x < matches.length; x++) {
var path = matches[x].replace(/\/index\.js/, '');
requirejsOptions['task' + x] = {
"options": {
"baseUrl": "./",
@ronhornbaker
ronhornbaker / twitter-friends.rb
Last active May 25, 2017 00:21
Get list of friends of a Twitter user, using the Twitter gem v5 (https://github.com/sferik/twitter), the Twitter APIv1.1, and Ruby.
require 'rubygems'
require 'twitter'
# see https://github.com/sferik/twitter
def twitter_client
Twitter::REST::Client.new do |config|
config.consumer_key = "XXXXXX"
config.consumer_secret = "XXXXXX"
config.access_token = "XXXXXX"
@mxhold
mxhold / no-trailing-slashes-nginx-and-middleman.md
Last active January 21, 2019 00:10
Prevent trailing slashes in URLs with Middleman and Nginx

So you want to have pretty URLs with no trailing slash or .html like:

http://mysite.com/blog/my-new-kitten

not like:

http://mysite.com/blog/my-new-kitten/

or

@kannaiah
kannaiah / bash-cheatsheet.sh
Created March 26, 2019 17:16 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@SantoshSrinivas79
SantoshSrinivas79 / Inject javascript into HTML pages from console.md
Last active May 12, 2021 05:51
Inject javascript into HTML pages from console

#Inject javascript into HTML pages from console

An easy way to inject Javascripts into the current loaded dom using the developer console in chrome.

jQuery

var script = document.createElement('script');
script.src = 'http://code.jquery.com/jquery-1.7.2.min.js';
@doofusdavid
doofusdavid / gist:6072257
Created July 24, 2013 16:42
quick and dirty wordpress slug generator in excel for data import from an existing database.
=LOWER(CLEAN(SUBSTITUTE(TRIM(C2)," ","-")))
@tprynn
tprynn / util.js
Last active February 1, 2022 13:34
Frida utility functions
module.exports = {
hexStringToIntArray: function(str) {
var res = []
for(var i = 0; i < str.length; i += 2) {
res.push(parseInt(str.substring(i, i+2), 16))
}
return res
},
byteArrayToHexString: function(array) {