Skip to content

Instantly share code, notes, and snippets.

View endolith's full-sized avatar
😑

endolith

😑
View GitHub Profile
@endolith
endolith / -Readme.txt
Created February 27, 2009 17:22
Ubiquity commands
// -----------------------------------------------------------------
// Description page for these Ubiquity commands: http://www.endolith.com/ubiquity_commands.html
// -----------------------------------------------------------------
// I guess only one link rel="commands" works per page, so for now, at least, all commands are in one gist, separated into files based on subject.
// Some of these ain't workin since 0.5. Need to fix them.
// For http://www.jslint.com/ :
/*global CmdUtils, Utils, context, displayMessage, noun_arb_text, noun_type_url, _*/
@endolith
endolith / Readme.txt
Created March 4, 2009 21:28
This is a gist experiment
I'm not really sure how to work with this site or divide up gists yet...
Only one link rel="commands" works per page, so for now, at least, I need to keep them all in one gist:
http://gist.github.com/gists/71580
and then include them from another site?
http://www.endolith.com/ubiquity_commands.html
@endolith
endolith / Readme.txt
Last active July 23, 2024 18:43
Gnome to Wine color scraper
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py"
3. Restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
This is also stored on https://code.launchpad.net/~endolith/+junk/wine-color-scraper
@endolith
endolith / LICENSE.txt
Last active March 22, 2018 21:05
Microsoft .URL file launcher
MIT License
Copyright (c) 2008 [email protected]
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 without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@endolith
endolith / commands.sh
Created March 13, 2009 14:17
fish bash cheatsheet
# I hate the command line.
# I use fish as my default shell http://www.fishshell.org/
# List disk usage of each subdirectory
du -s --si *
# Access one computer from the other, regardless of whether Internet is down, Dynamic DNS is down, Wireless is down, or computer is outside of LAN
# Tomato assigns different hostnames to different MAC addresses, regardless of which computer it is, so I have a separate _wired hostname
function desktop --description 'Connect to desktop machine through SSH'
@endolith
endolith / template.js
Created March 25, 2009 20:09
Ubiquity template
/* This is a template command. */
CmdUtils.CreateCommand({
names: ["example"],
icon: "http://www.mozilla.com/favicon.ico",
description: "A short description of your command.",
help: "How to use your command.",
author: {name: "Your Name", email: "[email protected]"},
license: "GPL",
homepage: "http://labs.mozilla.com/",
arguments: [{role: 'object', nountype: noun_arb_text}],
@endolith
endolith / mouse_movement_tester.pde
Created May 16, 2009 23:02
Processing sketch to show your mouse's movement
// Processing sketch to show your mouse's movement
// Linux's mouse acceleration really sucks.
void setup() {
size(800, 800);
background(0);
}
void draw(){
if (mousePressed == true) {
@endolith
endolith / fusc.py
Created May 18, 2009 04:05
Python function for generating the nth number of Stern's diatomic series recursively
def fusc(n):
"""Return the nth number of Stern's diatomic series recursively"""
if n == 0 or n == 1:
return n
elif n > 0 and n % 2 == 0: # even
return fusc(n // 2)
elif n > 0 and n % 2 == 1: # odd
return fusc((n - 1) // 2) + fusc((n + 1) // 2)
else:
@endolith
endolith / gcd_and_lcm.py
Last active June 22, 2022 23:33
GCD and LCM functions in Python for several numbers
# Greatest common divisor of 1 or more numbers.
from functools import reduce
def gcd(*numbers):
"""
Return the greatest common divisor of 1 or more integers
Examples
--------
@endolith
endolith / Mac OS X jyProcessing.sh
Created May 23, 2009 03:40
Python Processing using Jython in Ubuntu
#!/bin/sh
# This file was generated by the Jython installer
# Created on Mon May 19 20:25:40 CEST 2008 by me
CP="/Users/me/jython2.2.1/jython.jar:/Applications/Processing/lib/core.jar"
if [ ! -z "$CLASSPATH" ]
then
CP=$CP:$CLASSPATH
fi