This file contains 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
// ==UserScript== | |
// @name Assign to me (Bugzilla) | |
// @namespace http://wol.ph/ | |
// @version 1.0 | |
// @description | |
// @match http://bugzilla.3xo.eu/show_bug.cgi?id=* | |
// @copyright 2015, Wolph | |
// ==/UserScript== | |
var assigned_to_field = document.getElementsByName('assigned_to')[0]; |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using System.IO.MemoryMappedFiles; | |
using System.Threading.Tasks; | |
using System.Net.Sockets; | |
using System.Threading; | |
using System.Runtime.InteropServices; |
This file contains 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
// ==UserScript== | |
// @name Computer Futures Worksheet Filler | |
// @namespace http://wol.ph/ | |
// @version 1.1 | |
// @description | |
// @match https://worksheets.computerfutures.com/index.php?dir=timesheet* | |
// @match http://worksheets.computerfutures.com/index.php?dir=timesheet* | |
// @copyright 2015, Wolph | |
// @run-at document-end | |
// ==/UserScript== |
This file contains 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
# Quicksort using the Y Combinator (lambda calculus) in pure Python | |
>>> Y = lambda f: lambda *args: f(Y(f))(*args) | |
>>> quicksort = Y(lambda f: | |
... lambda x: ( | |
... f([item for item in x if item < x[0]]) | |
... + [y for y in x if x[0] == y] | |
... + f([item for item in x if item > x[0]]) | |
... ) if x else []) |
This file contains 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
LIGHT_ID = 123 | |
LIGHT_LEVEL = 40 | |
DOMOTICZ_URL = 'http://domoticz/json.htm?' | |
def fetch(**kwargs): | |
import json | |
import urllib | |
params = urllib.urlencode(kwargs.items()) | |
url = DOMOTICZ_URL + params |
This file contains 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
perl -pi -e 's/"\{\{\s*STATIC_URL\s*\}\}\/?([^"]+)"/"{% static \x27$1\x27 %}"/g' templates/***/*.html |
This file contains 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
import warnings | |
import functools | |
def ignore_warning(warning, count=None): | |
def _ignore_warning(function): | |
@functools.wraps(function) | |
def __ignore_warning(*args, **kwargs): | |
with warnings.catch_warnings(record=True) as ws: | |
# Catch all warnings of this type |
This file contains 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
/** | |
* @fileoverview Provides the custom function BUGZILLA_TITLE and | |
* the helper functions that it uses. | |
*/ | |
/** | |
* Runs when the add-on is installed. | |
*/ | |
function onInstall() { | |
onOpen(); |
This file contains 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
Y = lambda f: lambda *args: f(Y(f))(*args) | |
quicksort = Y(lambda f: | |
lambda x: ( | |
f([item for item in x if item < x[0]]) | |
+ [y for y in x if x[0] == y] | |
+ f([item for item in x if item > x[0]]) | |
) if x else []) |
This file contains 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
// ==UserScript== | |
// @name Computer Futures Worksheet Usability Enhancer | |
// @namespace http://wol.ph/ | |
// @description try to take over the world! | |
// @author Wolph | |
// @match https://worksheets.computerfutures.com/index.php?* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ | |
'use strict'; |