This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Section "Monitor" | |
| Identifier "Monitor0" | |
| VendorName "Unknown" | |
| ModelName "SHARP HDMI" | |
| HorizSync 15.0 - 75.0 | |
| VertRefresh 23.0 - 76.0 | |
| Option "DPMS" | |
| EndSection | |
| Section "Screen" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # I couldn't get the GUI tools to do the right thing so I edited the generated file by hand. | |
| # the key magic is the Option Rotate right along with the placement | |
| # nvidia-xconfig: X configuration file generated by nvidia-xconfig | |
| # nvidia-xconfig: version 295.40 (buildmeister@swio-display-x86-rhel47-04.nvidia.com) Thu Apr 5 22:33:07 PDT 2012 | |
| Section "ServerLayout" | |
| Identifier "Layout0" | |
| Screen 0 "Screen0" 0 0 | |
| InputDevice "Keyboard0" "CoreKeyboard" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function(){ | |
| /* poll for commands to run. I mostly use it with window.location.reload(true); */ | |
| function remoteCommand() { | |
| $.ajax({ | |
| url: "/wp-content/themes/thr3/remoteCommand.php", | |
| cache: false, | |
| timeout: 100000, | |
| success: function(data) { | |
| if (data != 'no') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I keep forgetting how to do this... | |
| To play audio in Safari on the iPad using javascript you have to create the audio node in response to a user event. You have to give the audio node a legal url and call load. Then reuse that same node to play sounds in the future. | |
| In jquery mobile I bound to the 'tap' event on body. If I haven't already created the audio object I create it there. Then I can use it later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (komodo.view) { komodo.view.setFocus() }; | |
| komodo.doCommand('cmd_save') | |
| ko.run.output.kill(-1); | |
| setTimeout(function(){ | |
| ko.run.runEncodedCommand(window, '%(python) -i \"%F\" {\'cwd\': u\'%D\'}'); | |
| }, 100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| '''I run this with crontab using the line: | |
| 1 8-17 * * 1-5 /home/gb/bin/muteRadio | |
| ''' | |
| import sys | |
| import os | |
| import time | |
| import dbus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from difflib import Differ | |
| from pprint import pformat | |
| def diff(o1, o2): | |
| po1 = pformat(o1).splitlines() | |
| po2 = pformat(o2).splitlines() | |
| d = Differ() | |
| r = [ line for line in d.compare(po1, po2) if line[0] in '+-' ] | |
| return '\n'.join(r) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dojo.provide('uow.hitcher'); | |
| /* | |
| uow.hitcher: provide additional control over callbacks | |
| usage: | |
| my = uow.hitcher({ callPeriod: 500 }); // note this didn't hitch, it created a hitcher named my. | |
| your = uow.hitcher(); // this one is independent of the first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # monkey patch the python json module to handle undefined | |
| import json | |
| json.decoder._CONSTANTS['undefined'] = None | |
| json.scanner.pattern('(-?Infinity|NaN|true|false|null|undefined)')(json.decoder.JSONConstant) | |
| json.decoder.JSONScanner = json.decoder.Scanner(json.decoder.ANYTHING) | |
| if __name__ == '__main__': | |
| print json.loads('{ "foo": 1, "bar": undefined }') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| '''Yet another Montage experiment for desktop wallpaper | |
| This version works with a variant on the "Pseudo-Poisson" dart throwing algorithms | |
| that were popular in stochastic ray-tracing years ago. It throws darts at a rectangular | |
| region ensuring that no darts are closer together than a minimum distance. It allows the | |
| minimum distance to scale down so you can have some big pictues and some smaller pictures. | |
| The help text was intended to be self explanatory... |