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
(function($) | |
{ | |
var results = []; | |
$("a div.workshopItemTitle").each(function(index, value) | |
{ | |
results.push($(value).parent().attr("href").split("?id=")[1]); | |
}); | |
alert(results.join("\n")); |
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
(function($) | |
{ | |
$.fn._center = function(self, parent, dimension) | |
{ | |
if(!dimension.vertical && !dimension.horizontal) | |
return; //won't do anything anyway | |
if(parent) | |
parent = self.parent(); | |
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
AttrType[] find_attributes(AttrType, alias Thing)() | |
{ | |
AttrType[] result; | |
foreach(attr; __traits(getAttributes, Thing)) | |
static if(is(typeof(attr) == AttrType)) | |
result ~= [attr]; | |
return result; | |
} |
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 gl3n.util: is_matrix, is_vector; | |
auto to_gfm(MatrixType)(MatrixType matrix) | |
if(is_matrix!MatrixType) | |
{ | |
static import gfm.math; | |
enum matrixSize = matrix.cols * matrix.rows; | |
matrix.mt[matrixSize] data; | |
matrix.mt *ptr = matrix.value_ptr; |
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
body { | |
background-color: #272822; | |
} | |
div#cgit { | |
padding: 0em; | |
margin: 0em; | |
font-family: sans-serif; | |
font-size: 10pt; | |
color: white; |
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
string string_prompt(Window parent, string prompt, string initialValue = null) | |
{ | |
string result; | |
auto window = new Window(parent, "Prompt"); | |
auto label = new Label(window, prompt); | |
auto input = new Entry(window); | |
auto okButton = new Button(window, "OK"); | |
auto cancelButton = new Button(window, "Cancel"); | |
void close(CommandArgs _ = CommandArgs.init) |
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
#!/bin/bash | |
cacheFile=~/bin/updates.cache | |
cacheFileNew=~/bin/updates-new.cache | |
function getignores() | |
{ | |
#list ignored packages here, like so: | |
#echo "packagename" | |
#TODO: actually parse pacman.conf |
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
void ensure_throws(ExceptionType = Exception)(void delegate() callable, string message = "") | |
{ | |
import core.exception: AssertError; | |
try | |
{ | |
callable(); | |
assert(false, message); | |
} | |
catch(ExceptionType err) {} |
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
//adapted from http://stackoverflow.com/a/7262117 | |
private real noise(long x, long y) | |
{ | |
long initial = x + y * 57; | |
initial = (initial << 13) ^ initial; | |
real intermediate = ( | |
1.0L - ( | |
( | |
result * ( | |
result ^^ 2 + 15731 + 789221 |
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
#!/usr/bin/env python2 | |
mimeList = "" | |
mapping = {} | |
with open("/etc/mime.types", "r") as f: | |
mimeList = f.read().split("\n") | |
for entry in mimeList: | |
entry = entry.split("\t") |
OlderNewer