Skip to content

Instantly share code, notes, and snippets.

View dessibelle's full-sized avatar
🦊
Yes

Simon Fransson dessibelle

🦊
Yes
View GitHub Profile
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

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:

@p01
p01 / LICENSE.txt
Last active March 9, 2024 13:40 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@pysysops
pysysops / custom_awsvault.p10k.zsh.part
Last active October 26, 2023 09:52
Powerlevel10k custom prompt config for use with aws-vault https://github.com/99designs/aws-vault
##############[ custom_awsvault: current aws account (https://github.com/99designs/aws-vault) ]###############
awsvault_prompt() {
if [ ! -z "${AWS_VAULT-}" ]; then
echo -n " ${AWS_VAULT-} "
fi
}
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT="awsvault_prompt"
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT_FOREGROUND="black"
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT_BACKGROUND="yellow"
typeset -g POWERLEVEL9K_CUSTOM_AWSVAULT_VISUAL_IDENTIFIER_EXPANSION=' ☁️'
@Bouke
Bouke / gist:11261620
Last active August 3, 2023 01:46
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@kares
kares / jquery.parseparams.js
Created May 5, 2011 11:28
jQuery.parseParams - parse query string paramaters into an object
/**
* $.parseParams - parse query string paramaters into an object.
*/
(function($) {
var re = /([^&=]+)=?([^&]*)/g;
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space
var decode = function (str) {return decodeURIComponent( str.replace(decodeRE, " ") );};
$.parseParams = function(query) {
var params = {}, e;
while ( e = re.exec(query) ) {
@mhulse
mhulse / helpers.py
Created June 15, 2011 19:34
Django (1.3) Google Maps v3 Geocoder service lookup example
import urllib, urllib2, simplejson
from django.utils.encoding import smart_str
def get_lat_lng(location):
# http://djangosnippets.org/snippets/293/
# http://code.google.com/p/gmaps-samples/source/browse/trunk/geocoder/python/SimpleParser.py?r=2476
# http://stackoverflow.com/questions/2846321/best-and-simple-way-to-handle-json-in-django
# http://djangosnippets.org/snippets/2399/
@statico
statico / gist:3172711
Created July 24, 2012 21:15
How to use a PS3 controller on Mac OS X 10.7 (Lion)

How to use a PS3 controller on Mac OS X 10.7 (Lion)

  1. Open Apple menu -> System Preferences -> Bluetooth and disable Bluetooth on Mac as well as any other nearby Macs or devices which will try to pair with and confuse the controller.

  2. Reset PS3 controller by inserting paperclip into pinhole near L2 button.

  3. Connect PS3 controller to Mac with USB cable.

  4. Enable Bluetooth.

@kaelig
kaelig / Gemfile
Created September 7, 2011 00:20
Sass & CoffeeScript automated compiling and minifying with Guard
source "http://rubygems.org"
group :development do
gem 'rake'
gem 'guard'
gem 'coffee-script'
gem 'rb-fsevent'
gem 'rb-inotify'
gem 'compass', '0.11.5'
gem 'sass', '3.1.5'
gem 'guard-compass'
@elijahmanor
elijahmanor / fiddle-slow.js
Created July 25, 2012 05:09
Just In Time Initialization of jQuery UI Date Picker On Focus
$( document ).ready( function() {
$( "input.date" ).datepicker({
minDate: moment().subtract( "months", 1 ).toDate(),
maxDate: moment().add( "months", 1 ).toDate(),
dateFormat: "d M, y",
constrainInput: true,
beforeShowDay: $.datepicker.noWeekends
});