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
/*jslint white: false, onevar: false, laxbreak: true, maxerr: 500000 | |
*/ | |
/*global require console process | |
*/ | |
var http = require('http'), | |
url = require('url'), | |
fs = require('fs'); | |
function mystat(path) { |
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/perl | |
use common::sense; | |
use Math::BigInt; | |
my $orig = $ARGV[0] ? Math::BigInt->new(shift) : Math::BigInt->new(1 . (0 x 3000)) + 7; | |
my $res = blog_reduce($orig); | |
print stringify_series( $res ), "\n"; |
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
package dumb_thing; | |
use strict; use warnings; | |
use Tie::Array; | |
use Carp; | |
use base 'Tie::StdArray'; | |
sub TIEARRAY { | |
my $class = shift; | |
my $this = bless [], $class; |
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/perl | |
use strict; | |
for my $pid (1..32000) { | |
if( open IN, "/proc/$pid/cmdline" ) { | |
my @x = <IN>; | |
my $x = `ps $pid | tail -n +2`; | |
s/[^\/\.\-\_\d\w]/ / for @x; |
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
#!/bin/bash | |
# don't run this, source it | |
# source cisco-like-help.sh | |
function ciscolikehelp() { | |
if [[ $READLINE_POINT=${#READLINE_LINE} && "$READLINE_LINE" =~ \ $ ]]; then | |
cmd="$( sed -e 's/.*[;|]//' -e "s/ .*//g" <<< "$READLINE_LINE" )" | |
pcmd=$( type -P $cmd ) | |
TYPE=$( type -t ${pcmd:-$cmd} ) |
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
s/\x00/␀/g; # seems like 00 => 2400 | |
s/\x07/␇/g; # and 07 => 2407 … implies that there's | |
# an easy transform that would literally do | |
# \x00 — \0x20 → \u2400 — \u2420 automatically. | |
# damned if I know it though. | |
__END__ | |
#perl corgifex suggests something like: "\0\1\2"; s/([\x00-\x1f])/"\x{2400}" | $1/eg |
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
# Copyright (C) 2010 The Android Open Source Project | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
#!/bin/bash | |
ACTUAL_DISPLAY=:0 | |
NUM=$(echo $DISPLAY | sed s/://) | |
PORT="55$NUM" | |
TARGET=127.0.0.1:$PORT | |
function killthemall() { | |
echo;echo "-----------------:= $(date) killing all running vncviewers and x11vncs" | |
for tokill in x11vnc vncviewer; do |
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
" … blah … | |
" WARNING: There are probably security problems with using /tmp/ for this!!! \o/ | |
" If this directory isn't owned by the current user and not world writable, | |
" it's highly likely nefarious evildoers could elite haxx into your vim | |
" memories through the swap files. (… project for later …) | |
" (:-2 to remove end of line) | |
" &g:directory is the global option directory | |
" let &g:directory="poo" is roughly equiv to set dir=poo |
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/perl | |
use common::sense; | |
my $trials = shift // 1_000; | |
my $orig_t = $trials; | |
my $DOORS = shift // 3; | |
my $switch_wins = 0; | |
my $stay_wins = 0; |