Skip to content

Instantly share code, notes, and snippets.

"""
ILDA Header Format:
1-4: "ILDA"
5-7: Reserved
8: Format Code
9-16: Frame or Color Palette Name
17-24: Company Name
25-26: Number of Records
27-28: Frame or Color Palette Number
29-30: Total Frames or 0
@asteig
asteig / dijkstra.lua
Last active July 13, 2021 09:34
Dijsktra's Algorithm in Lua
-- Dijkstra's Algorithm
-- g: a graph of all nodes
-- source: id of start node
function getAllPaths(g, source)
dist = {}
prev = {}
q = {} -- "queue"
-- init values
@asteig
asteig / propose-and-reject.py
Last active August 18, 2020 22:27
Stable Matching - Propose-And-Reject Algorithm (Gale-Shapely)
# Stable Matching Problem
# Preference Profile
prefs = {
'Xavier': ['Amy', 'Bertha', 'Clare'],
'Yancey': ['Bertha', 'Amy', 'Clare'],
'Zeus': ['Amy', 'Bertha', 'Clare'],
'Amy': ['Yancey', 'Xavier', 'Zeus'],
'Bertha': ['Xavier', 'Yancey', 'Zeus'],
'Clare': ['Xavier', 'Yancey', 'Zeus']
var Keys {
code2Key: function(code) {
return this.code_key[code];
},
key2Code: function(key) {
return this.code_key[key];
},
@asteig
asteig / dribbble.js
Last active August 29, 2015 14:16
Dribbble Color Mod
var shotId = $('.the-shot').data('screenshot_id');
$('.meta-colors').click(function(ev) {
ev.preventDefault();
if($(ev.target).is('img')) {
var colors = '';
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@asteig
asteig / gist:b5351a9d9b9d68142a1c
Created March 7, 2015 18:40
Command - Generate Dummy Images
mkdir img && cd img && wget -O 1.jpg http://lorempixel.com/200/200/ && wget -O 2.jpg http://lorempixel.com/200/200/ && wget -O 3.jpg http://lorempixel.com/200/200/ && wget -O 4.jpg http://lorempixel.com/200/200/ && wget -O 5.jpg http://lorempixel.com/200/200/ && wget -O 6.jpg http://lorempixel.com/200/200/ && wget -O 7.jpg http://lorempixel.com/200/200/ && wget -O 8.jpg http://lorempixel.com/200/200/ && wget -O 9.jpg http://lorempixel.com/200/200/ && wget -O 10.jpg http://lorempixel.com/200/200/
sudo apt-get install dkms
sudo dkms ldtarball psmouse-elantech-x551c.tar.gz
sudo dkms install -m psmouse -v elantech-x551c
sudo rmmod psmouse
sudo modprobe psmouse
@asteig
asteig / gist:770636
Created January 8, 2011 07:14
Studious Student
<?php
//grab an array from input file
$handle = fopen("input.txt", "r");
$i = 0;
while (!feof($handle) ) {
$lines[$i] = trim(fgets($handle));
$i++;
-----------------------------------------------------
_ .-.
/ ) .-. ___ __ ( )
( ( ( ) .'___) (__'-._) (
\ '._) (,'.' '. '-.
'. / "\ ' -. '.
) / \ \ .-. ,'. ) ( ',_) _
.' ( \ \ ( \ . .' .' ) .-. ( \
( .''. '. \ \| .' .' ,',--, / ( ) ) )
\ \ ', : \ .-' ( ( ( ( _) (,' /