Skip to content

Instantly share code, notes, and snippets.

View k2052's full-sized avatar
🦄
awesome

K k2052

🦄
awesome
View GitHub Profile
@Zulko
Zulko / zombie_france.py
Last active May 24, 2024 21:54
Zombie pandemic simulation in France
"""
Model of a Zombie outbreak in France, starting in Grenoble
This is a rewrite from this blog post by Max Berrgren:
http://maxberggren.github.io/2014/11/27/model-of-a-zombie-outbreak/
with a different country, a slightly different model, and different
libraries. The map of population density is taken from Wikimedia Commons
@maccman
maccman / jquery.ajax.queue.coffee
Last active January 13, 2018 12:03
Queueing jQuery Ajax requests. Usage $.ajax({queue: true})
$ = jQuery
queues = {}
running = false
queue = (name) ->
name = 'default' if name is true
queues[name] or= []
next = (name) ->
@jwilling
jwilling / gist:4186817
Last active March 5, 2023 22:01
Lets help improve AppKit.

Is AppKit causing you frustration? Instead of just complaining about it, lets try to make it better by compiling a list of specific problems with AppKit. Leave a comment below, and I'll include it in the list.


##NSView##

  • NSView does not have the ability to set an affine transform (rdar://15608609)
  • Controls that have cells (such as NSTextField) do not respond properly when layer-backed. Take NSButton as an example. When not layer-backed, it will animate properly using the animator proxy. When layer-backed, using the animator proxy breaks focus rings (they jump to destination immediately). Currently, directly manipulating the layer of a cell-based control is not supported (and will lead to a broken interface), but is much needed. (rdar://15608822)

##NSViewController##

  • NSViewController could be more useful. It has -loadView but no other lifecycle methods. (rdar://15608948)
@jacobmendoza
jacobmendoza / HTML5BezierExperiment.js
Created November 6, 2012 12:14
HTML5 Bezier experiment
<html>
<head>
<script type="application/javascript">
var _context = null;
var _counter = 0;
var _maxIterations = 15;
var _current_x_position = 0;
var _current_y_position = 384;
function draw() {
@viddo
viddo / jasmine_config.rb
Created October 16, 2012 16:47
Allow custom rack build on top of jasmine-gem
# Custom jasmine config based to allow Sprockets assets (+ CoffeeScript) when writing tests on a Sinatra stack.
#
# Based heisters gist and patch which was for version 1.2.0
# https://gist.github.com/1695818
# https://github.com/heisters/jasmine-gem/commit/15277ed7885a5d08ab84d2a4a2417e0d22564c07
# Simply did a small port of this to the latest version of Jasmine.
#
# For the custom rack build to work you have to setup the gem to use the patched version to work correctly.
# E.g. using bundler put this in your Gemfile:
# gem 'jasmine', :git => 'https://github.com/viddo/jasmine-gem.git'
@josephwecker
josephwecker / new_bashrc.sh
Created August 11, 2012 04:36
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
@fstrube
fstrube / basecamp-todos.js
Created July 15, 2012 19:52
Bookmarklet to make Basecamp todo's better (parse priority and progress, similar to todo.txt)
;(function(){
var todos = $$('.item .content span .content span:first-child');
todos.each(function(element) {
if ( element.getAttribute('data-original-text') ) element.innerText = element.getAttribute('data-original-text');
parseTodo(element);
});
function parseTodo(element) {
/* Original Text */
@rakhmad
rakhmad / clojure.md
Created April 17, 2012 15:55
Setting Up Clojure on OS X

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@fjolnir
fjolnir / tlc.lua
Last active February 15, 2024 15:01
LuaJIT ObjC bridge
The bridge is now located at https://github.com/fjolnir/TLC