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
$('<div>', { | |
class: 'question-summary', | |
id: 'question-summary-QID', | |
html: $('<div>', { | |
class: 'statscontainer', | |
html: $('<div>', { | |
class: 'statsarrow' | |
}) | |
}).append($('<div>', { | |
class: 'stats', |
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
$('a.l').map(function(i, e) { | |
return !e.search ? e.href : (function(s) { | |
var u = '?'; | |
s.split('&').forEach(function(ee, ii) { | |
var e = ee.split('='); | |
if (e[0] == 'url') | |
u = e[1]; | |
}); | |
return decodeURIComponent(u); | |
})(e.search); |
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 Hippietrail's StackExchange search to Google search | |
// @description Convert a search on a StackExchange site to a Google search of that site | |
// @version 0.0 | |
// @namespace hippietrail | |
// @include http://stackoverflow.com/search* | |
// @include http://meta.stackoverflow.com/search* | |
// @include http://serverfault.com/search* | |
// @include http://meta.serverfault.com/search* | |
// @include http://superuser.com/search* |
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
var fs = require('fs'), | |
StringDecoder = require('string_decoder').StringDecoder, | |
util = require('util'); | |
function lineByLine(fd) { | |
var blob = ''; | |
var blobStart = 0; | |
var blobEnd = 0; | |
var decoder = new StringDecoder('utf8'); |
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/perl | |
# stripgutenberg.pl < in.txt > out.txt | |
# | |
# designed for piping | |
# Written by Andrew Dunbar (hippietrail), released into the public domain, Dec 2010 | |
use strict; | |
my $debug = 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
import Foundation | |
/// Executes two commands in a pipeline. | |
/// | |
/// - Parameters: | |
/// - firstCommand: The first command to execute. This should be a valid | |
/// command that you would type into the terminal. | |
/// - secondCommand: The second command to execute. This should be a valid | |
/// command that you would type into the terminal. | |
/// - args: The command line arguments passed to the script. |
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 url from 'url'; | |
interface Cue { | |
transcriptCueRenderer: { | |
cue: { | |
simpleText: string; | |
}; | |
}; | |
} |
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
// adds the %hb specifer to print a number of bytes in human-readable number of bytes/kb/mb | |
// there's no way to modify or build a va_list after handling some of them ourselves | |
// so we get the standard function to ignore them by treating them as zero-length strings | |
// this could be a problem for compilers that evaluate a number as a string pointer before truncating | |
// but it works with clang on Xcode 15.3 | |
// there's no buffer overflow handling to make the code easy to follow - don't deploy as-is in real code! | |
void custom_fprintf(FILE* stream, const char* format_orig, ...) { | |
size_t format_orig_len = strlen(format_orig); | |
va_list args_orig, args_copy; |
OlderNewer