Skip to content

Instantly share code, notes, and snippets.

View F1LT3R's full-sized avatar
🌱
Growing Things

Alistair MacDonald F1LT3R

🌱
Growing Things
View GitHub Profile
@F1LT3R
F1LT3R / chrome-disable-same-origin-policy
Created December 20, 2014 06:07
Chrome Disable Same Origin Policy
open -a Google\ Chrome --args --disable-web-security
@F1LT3R
F1LT3R / display-resolution.sh
Created December 30, 2014 22:24
get os x display resolution
system_profiler SPDisplaysDataType | grep Resolution
@F1LT3R
F1LT3R / Default (OSX)sublime-keymap.json
Last active October 23, 2023 20:04
word wrap with ctrl + shift + w in sublime-text
[
{ "keys": ["ctrl+shift+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}
]
// Thanks to "facelessuser"
// https://www.sublimetext.com/forum/viewtopic.php?f=3&t=6663

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@F1LT3R
F1LT3R / compare-all.js
Last active August 29, 2015 14:15
Compare every indice with every other only once
function test(n){
return n*(n-1)/2;
}
function compareAll(ary, compareCb, doneCb){
var a = 0
, b = 0
, size = ary.length
@F1LT3R
F1LT3R / gist:b8ac5a3a026e9feddb2c
Last active August 29, 2015 14:17
Variables in Django
{% with False as something %}
{% if something %}
True
{% else %}
False
{% endif %}
{% endwith %}
var app = angular.module('app.directives.myModule', []);
app.directive('myModule', [function () { return {
restrict: 'E',
scope: {
thingsA: '=',
thingsB: '=',
},
controller: ['$scope', function ($scope) {
@F1LT3R
F1LT3R / theme.xml
Created April 16, 2015 13:03
living theme
<?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>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
<key>name</key>
@F1LT3R
F1LT3R / where-epubs-live.md
Created April 19, 2015 14:36
Kindle Cloud Directory

Where to put .epub files on OSX if you want to read them in Kindle CLoud reader:

~/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/My Kindle Content

You can find the dir in Kindle Cloud Reader > Preferences > General > "Content Folder"

app.controller('MyController', ['$rootScope', function($rootScope) {
$rootScope.$on('$stateChangeStart', function (event, toState) {
usSpinnerService.spin('spinner-1');
});
$rootScope.$on('$stateChangeSuccess', function (event, toState) {
usSpinnerService.stop('spinner-1');
});