Skip to content

Instantly share code, notes, and snippets.

@varlen
varlen / scriptingBridge.py
Created June 3, 2016 01:01
Apple Scripting Bridge example
from Foundation import *
from ScriptingBridge import *
# Returns the methods of the object
def __methods( theObject ):
return [method for method in dir(theObject) if callable(getattr(theObject, method))]
# Elements present in one list but not in the other
def __diffList( A, B):
return list( set( A ) - set( B ) )
@haasn
haasn / about:config.md
Last active December 27, 2024 15:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

@tswicegood
tswicegood / gist:29a64ba7f3c07cbd5381
Created April 11, 2015 05:39
Talk submission to ONA

Newb's Mind, Expert's Mind

Expertise syndrome is a silent killer of knowledge in information-based industries – whether that’s a news room or a tech shop. Remembering what it was like to use your tools when you didn't know what you didn't know makes it harder for you to communicate with people who are starting out. How do you put yourself in the beginner's mind? Can doing that help you create the next generation of experts in your community? This talk explores those themes and helps you find and implement strategies to share your knowledge in a way that's accessible to everyone, regardless of where they are on their journey.

In A Tweet

Newb's Mind, Expert Mind: How to teach beginners by changing the way you think.

How does your submission contribute to the diversity of the conference?

@fallroot
fallroot / open-notification-center-with-jxa.js
Created February 12, 2015 19:00
Open OSX Notification Center with JXA
Application('System Events')
.processes['SystemUIServer']
.menuBars
.menuBarItems
.whose({
name: 'Notification Center'
})
.menuBarItems()
.reduce(function(a, b) {
return a.concat(b);
@divanvisagie
divanvisagie / objc.js
Created June 15, 2013 17:28
A snippet with different usage examples in NodObjC. Not all of this works but the concepts are mainly correct
var $ = require( 'NodObjC' );
// First you import the "Foundation" framework
$.import( 'Foundation' );
$.import( 'Cocoa' );
// Setup the recommended NSAutoreleasePool instance
var pool = $.NSAutoreleasePool( 'alloc' )( 'init' );
// NSStrings and JavaScript Strings are distinct objects, you must create an
  • don't blow your deadline
  • don't be wrong
@kevincennis
kevincennis / gist:3928503
Created October 21, 2012 21:03
Instant karaoke track with the Web Audio API
var url = 'http://static1.kevincennis.com/sounds/callmemaybe.mp3'
, audio = new Audio(url)
, context = new webkitAudioContext()
// 512 samples per frame, stereo input, mono output
, processor = context.createJavaScriptNode(512, 2, 1)
, sourceNode
audio.addEventListener('canplaythrough', function(){
sourceNode = context.createMediaElementSource(audio)
sourceNode.connect(processor)
@mikeyk
mikeyk / gist:1329319
Created October 31, 2011 22:56
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])

"Other developers are just like us - weird"

"If you ever need to deploy Django, you're good. If you know Capistrano and Unicorn they've got rip-offs of all that stuff."

"I think we should all admit we're horrible coders and move on" "We're all drug addicts - we're fighting methods..."

"It's easy to learn to play the guitar and be able to play Bob Dylan and Weezer and never get better."

"This is basically a talk that was given 30 years ago. We just have to keep giving it every few years because young guys come along and forget it."

@kennethreitz
kennethreitz / sync.py
Created October 10, 2010 19:08
GitHub Syncer. Clones or Pulls all GitHub repos (including watched list).
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Kenneth Reitz's GitHub Syncer
This script uses the GitHub API to get a list of all forked, mirrored, public, and
private repos in your GitHub account. If the repo already exists locally, it will
update it via git-pull. Otherwise, it will properly clone the repo.
It will organize your repos into the following directory structure: