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 HN Toolkit | |
// @namespace http://news.ycombinator.com | |
// @description Version 1.8 - Various useful things (blacklist/style, saved links, searchyc, splitview, PRE-fix, new preview, title rename) for Hacker News | |
// @include http://news.ycombinator.com/* | |
// ==/UserScript== | |
/* | |
Written by Xichekolas ... License: 'do whatever you want with it'. | |
http://news.ycombinator.com/user?id=Xichekolas |
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
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
COLOR_NONE="\[\e[0m\]" |
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
/** | |
* List ALSA pcm plugins. | |
* | |
* This code is based on code I saw in PortAudio, which is under the MIT license. | |
* http://portaudio.com/trac/browser/portaudio/trunk/src/hostapi/alsa/pa_linux_alsa.c | |
* | |
* Note that the method used here is quite different to detecting hw devices, | |
* which iterates over cards, devices and subdevices. | |
* | |
* gcc -o pcm_plugins pcm_plugins.c -lasound |
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
# Sample usage of Ruby recursive shadowcasting implementation: | |
# http://roguebasin.roguelikedevelopment.org/index.php?title=Ruby_shadowcasting_implementation | |
require "ShadowcastingFieldOfView" | |
class Map | |
def initialize(map) | |
@map = map | |
@view = Array.new(map.length) | |
@view.length.times do |y| |
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
diff -r -U 3 -x '*.o' -x nethack -x nhdat -x date.h vanilla/include/extern.h nethack-3.4.3/include/extern.h | |
--- vanilla/include/extern.h 2011-04-09 00:08:56.000000000 +1000 | |
+++ nethack-3.4.3/include/extern.h 2011-04-12 03:28:47.000000000 +1000 | |
@@ -638,6 +638,7 @@ | |
E int NDECL(open_savefile); | |
E int NDECL(delete_savefile); | |
E int NDECL(restore_saved_game); | |
+E int NDECL(saved_game_exists); | |
E void FDECL(compress, (const char *)); | |
E void FDECL(uncompress, (const char *)); |
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
diff -U 3 -r nethack-3.4.3-pre-defername/sys/unix/unixmain.c nethack-3.4.3/sys/unix/unixmain.c | |
--- nethack-3.4.3-pre-defername/sys/unix/unixmain.c 2011-04-09 15:33:59.000000000 +1000 | |
+++ nethack-3.4.3/sys/unix/unixmain.c 2011-04-11 00:39:42.000000000 +1000 | |
@@ -160,6 +160,12 @@ | |
#endif | |
/* | |
+ * Set DECgraphics again in case option loading didn't set it. | |
+ */ | |
+ if(iflags.DECgraphics) |
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
diff -r -u nethack-3.4.3/src/allmain.c defername/src/allmain.c | |
--- nethack-3.4.3/src/allmain.c 2003-12-07 18:39:14.000000000 +0000 | |
+++ defername/src/allmain.c 2003-12-14 18:58:28.000000000 +0000 | |
@@ -450,6 +450,9 @@ | |
void | |
display_gamewindows() | |
{ | |
+ if(WIN_MESSAGE != WIN_ERR) | |
+ return; | |
+ |
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
// Ban a spambot | |
$('th:contains("Reason:") + td > input').val("Spambot"); | |
$('#main_ip_check').attr('checked', true); | |
$('#email_check').attr('checked', true); | |
$('#user_check').attr('checked', true); | |
$(':submit[name="add_ban"]').css('fontSize', '30pt'); |
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
<?php | |
/** | |
* Abstraction-breaking custom tag lister. | |
* This block lists all tags under the given taxonomy vocabulary, | |
* in order of frequency, and then name. The tags are hyperlinked. | |
*/ | |
$vocabulary_id = 8; | |
$cutoff = 15; // don't show results that don't pass the threshold | |
$threshold = 5; // after cutoff, don't show tags with counts less than this | |
$tag_query = "SELECT td.tid, td.name, COUNT(DISTINCT tn.nid) as num " . |
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
/* Hide the homepage's sidebar. */ | |
.guide-container { display: none !important; } | |
.guide-background { display: none !important; } | |
/* Hide recommended/promoted videos on the right. */ | |
#video-sidebar { display: none !important; } | |
/* Widen the subscription feed for our newly-freed space. */ | |
#feed { | |
margin-left: 0 !important; |
OlderNewer