Skip to content

Instantly share code, notes, and snippets.

View jwmann's full-sized avatar
🎯
Focusing

James W Mann jwmann

🎯
Focusing
View GitHub Profile
@brandonaaskov
brandonaaskov / jQuery Change Event: Proper Binding
Created January 11, 2012 21:34
jQuery's change() event doesn't work as expected with input text fields. This, however, does work.
/*
For some reason, the change() event only fires when the input field loses focus.
Binding to other options ('change keypress paste focus textInput input') will
fire the event several times, which is bad. The below code works even when
content is pasted into the text field, and only fires once as expected.
*/
$('#search-form .term').bind('input', function(){
console.log('this actually works');
});
@vitalyrotari
vitalyrotari / bootstrap.php
Created February 16, 2012 11:30
Language support for FuelPHP
/**
* app/bootstrap.php
*/
Autoloader::add_classes(array(
// Add classes you want to override here
// Example: 'View' => APPPATH.'classes/view.php',
'Uri' => APPPATH.'classes/uri.php',
'LayoutHelper' => APPPATH.'classes/layouthelper.php',
));

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@NoobsArePeople2
NoobsArePeople2 / gist:5121597
Last active November 10, 2023 14:33
Configure media keys on a non-Apple keyboard to control Spotify via AppleScript and USB Overdrive on OSX.

Requirements

  1. USB Overdrive
  2. A non-Apple keyboard with media keys (or keys you want to make "media" keys). For reference, I'm using a Microsoft Sidewinder X4

Set Up

  1. Plug in your keyboard and install USB Overdrive.
  2. Open USB Overdrive. Click into the Settings tab.
  3. Click the dropdown and select "Any Keyboard, Any Application"
@corradomatt
corradomatt / gravityforms-bs-datepicker.less
Last active November 28, 2023 20:34
Addon for using gravity forms with a bootstrap based development such as the roots.io theme for WordPress. I specifically wrote this for a roots theme and it's based on this post http://roots.io/style-gravity-forms-with-bootstrap/ by Ben Word.This goes one step further and provides support for some native gravity forms style declarations for for…
/**
* Borrowed from https://github.com/addyosmani/jquery-ui-bootstrap
* Styles the datepicker popup for gravityforms used with bootstrap
*/
/*
* jQuery UI Datepicker
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 5, 2024 04:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@Kartones
Kartones / postgres-cheatsheet.md
Last active May 3, 2024 20:51
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@andrewroberts
andrewroberts / Log.gs
Last active January 4, 2020 14:32
A simple wrapper for the BetterLog Google Apps Script Library - GAS Library MqTFuiXcPtS5rVUZ_jC9Z4tnfWGfgtIUb
// 34567890123456789012345678901234567890123456789012345678901234567890123456789
// JSHint: 22 March 2015 08:56 GMT
// Unit Tests: 22 March 2015 08:50 GMT
/*
* Copyright (C) 2015-2017 Andrew Roberts (andrew@roberts.net)
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software