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
*/*.pid | |
*/*.db | |
*/*.conf |
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
#Takes 2 arguments at command line: filename, shred width. | |
def unshred(img_name, shred_width): | |
image = Image.open(img_name) | |
data = image.getdata() | |
img_w, img_h = image.size | |
def get_pixel_value(x, y): | |
pixel = data[y * img_w + 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
var lzw = function(input_string){ | |
var dic = "abcdefghijklmnopqrstuvwzyz ".split(""); | |
var inp = input_string.split(""); | |
var buffer = ""; | |
var encoded = []; | |
while (inp.length > 0){ | |
var ch = inp.shift(); | |
if(dic.indexOf(buffer + ch) >= 0){ | |
buffer = buffer+ch; | |
}else{ |
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
javascript:(function(){var divs=["normalBG","normalFG","commentFG","constantFG","strFG","specFG","identFG","keyFG","incFG","typeFG","funFG","repFG","opFG"];for(var i=1;i<myscopes.length;i++){var randcolstring="";for(var j=0;j<3;j++){var randcol=(Math.floor(Math.random()*256)).toString(16);if(randcol.length==1){randcol="0"+randcol;}randcolstring=randcolstring+randcol;myscopes[i]=randcolstring;}$("#"+divs[i]).ColorPickerSetColor(myscopes[i]);$("#"+divs[i]+" div").css("background-color","#"+myscopes[i]);$("."+divs[i]).css("color","#"+myscopes[i]);}})(); |
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
(fn [f init & [args]] | |
(let [init-args (if (nil? args) init (cons init args))] | |
(map | |
#(reduce function (take % init-args)) | |
(map #(inc %2) init-args (range))))) |
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
(fn [a b] | |
(reduce | |
#(assoc % (first %2)(last %2)) | |
{} (partition 2 (interleave a b)))) |
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
(fn [f i] | |
(cons i | |
(map #((apply comp (repeat (inc %) f)) i) (range)))) | |
(fn f | |
[func init] | |
(lazy-seq | |
(cons init (f func (func init))))) | |
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
(fn [f a] | |
(reduce | |
(fn | |
[m x] | |
(assoc m (f x) | |
(conj (get m (f x) []) x))) | |
{} a)) |
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
-- -*-mode: C++; style: K&R; c-basic-offset: 4 ; -*- */ | |
-- | |
-- A simple HTTP server written in Lua, using the socket primitives | |
-- in 'libhttpd.so'. | |
-- | |
-- This server will handle multiple virtual hosts. The only requirement | |
-- is that each virtual host must have the documents located beneath | |
-- a common tree. Note that directory indexes are not (yet) supported. | |
-- |
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
_({first: 1, second: 2, text: 'string here' }) // put object to wrapper | |
.chain() // chaining enabled | |
.compact() // now work with: [1,2, 'string here'] | |
.size() // now: 3 | |
.value() // return result |