Skip to content

Instantly share code, notes, and snippets.

View bkad's full-sized avatar

Kevin Le bkad

  • Liftoff Mobile
  • Kirkland, Washington
View GitHub Profile
@rodricios
rodricios / summarize.py
Last active November 18, 2020 17:21
Flipboard's summarization algorithm, sort of
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pip install networkx distance pattern
In Flipboard's article[1], they kindly divulge their interpretation
of the summarization technique called LexRank[2].
@samuelclay
samuelclay / LED Dress.ino
Last active February 15, 2024 16:07
For New Year's Eve 2014, my girlfriend and I went to a dance party where wearable electronics were not only encouraged but also on display from a variety of hobbyists. I decided to use this as an opportunity to combine two of my favorite hobbies: sewing and electronics. We attached six addressable LED strands from Sparkfun ($20 each) to the lini…
#include <Adafruit_NeoPixel.h>
#include "WS2812_Definitions.h"
#define PIN_A 9
#define PIN_B 3
#define PIN_C 2
#define PIN_D 12
#define PIN_E 10
#define PIN_F 6
#define LED_COUNT 43
@danneu
danneu / golang-vs-clojure-async.md
Last active November 6, 2023 04:09
Google I/O 2012 - Go Concurrency Patterns ported to Clojure Video: http://www.youtube.com/watch?v=f6kdp27TYZs
@thesharp
thesharp / ML, Python and virtualenv.md
Created July 25, 2012 22:56
Quick virtualenv fix on Mountain Lion

Quick virtualenv fix on Mountain Lion

Overview

It appears that Apple somehow broke Python in Mountain Lion, so even with the latest Command Line Tools and Xcode 4.4 virtualenv won't properly work. During virtual environment creation it will try to install easy_install inside /Library hierarchy. So let's give it a quick workaround. Let's install custom python into your $HOME-directory using pythonbrew!

Installing proper Command Line Tools

Without the Apple Mac Developer account you won't even see the proper download link for the latest CL Tools and the old one won't work on ML. So here's the link: http://goo.gl/iBTXh. It points towards the Apple website so don't worry.

@ljos
ljos / cocoa_keypress_monitor.py
Last active January 6, 2024 07:36
Showing how to listen to all keypresses in OS X through the Cocoa API using Python and PyObjC
#!/usr/bin/env python
#
# cocoa_keypress_monitor.py
# Copyright © 2016 Bjarte Johansen <Bjarte.Johansen@gmail.com>
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# “Software”), to deal in the Software without restriction, including
@matthewp
matthewp / rel-template.js
Created June 19, 2012 19:08
Synchronous loading of templates in a link tag.
(function() {
"use strict";
Object.defineProperty(HTMLLinkElement.prototype, 'template', {
get: function() {
if(!/template/i.test(this.rel)) {
return "";
}
var req = new XMLHttpRequest();
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@cgrand
cgrand / maze.clj
Created January 24, 2011 08:02
A maze generator (Wilson's algorithm) which can work with any topography (hextiles, torus variants, teapot etc.)
; http://groups.google.com/group/clojure/browse_thread/thread/974e2c7f89e27231/5f4bff3e58dfa36f
; output images http://i.imgur.com/gSASS.png (square maze)
; http://i.imgur.com/uEqaq.png (hex maze)
;; generic Wilson's algorithm implementation
(defn maze
"Returns a random maze carved out of walls; walls is a set of
2-item sets #{a b} where a and b are locations.
The returned maze is a set of the remaining walls."
[walls]