Skip to content

Instantly share code, notes, and snippets.

хуита
говно
@polachok
polachok / bigint.c
Created May 19, 2012 09:09
bigint lol
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct bigint {
unsigned char *p;
int size;
};
typedef struct bigint BigInt;
@polachok
polachok / gist:2794155
Created May 26, 2012 14:34
no titles diff
diff --git a/echinus.c b/echinus.c
index d21bab7..2426307 100644
--- a/echinus.c
+++ b/echinus.c
@@ -191,8 +191,9 @@ unsigned int numlockmask;
struct {
Bool dectiled;
Bool hidebastards;
- int focus;
- int snap;
@polachok
polachok / attach.awk
Created July 15, 2012 14:52
hotplugd attach script
#!/usr/bin/awk -f
function rstrip(str) {
gsub(/ *$/, "", str)
return str
}
function lstrip(str) {
gsub(/^ */, "", str)
return str
}
function disk(dev) {
@polachok
polachok / wifi.awk
Created November 5, 2012 01:33
wireless/wired with failover
#!/usr/bin/awk -f
function run(cmd) {
if (system(cmd) != 0)
exit 1
}
BEGIN {
networks["my-super-network"] = "u1tr@SecURep@ssw0rd111"
iface = "wpi0"
wired = "em0"
iconDir = "/home/plhk/.xmobar/"
getIcon s = "<icon=" ++ iconDir ++ s ++ ".xbm" ++ ">"
------------------------------------------------------------------------
-- Now run xmonad with all the defaults we set up.
-- Run xmonad with the settings you specify. No need to modify this.
--
main = do
xmonad =<< statusBar "xmobar" myPP toggleStrutsKey defaults
@polachok
polachok / twitsearch.hs
Last active December 14, 2015 21:59 — forked from dpwiz/twitsearch.hs
import Data.Aeson
import Network.HTTP
import System.Environment (getArgs)
import Control.Monad (mapM_, void)
import Control.Monad.Trans.Maybe
import Control.Monad.Trans.Class (lift)
import qualified Data.ByteString.Lazy.Char8 as LBS
import qualified Data.Text as T -- can be traded for OverloadedStrings option
package main
// #include "cmarisa.h"
// #include <marisa/base.h>
// #cgo LDFLAGS: -lcmarisa -L/usr/local/lib
import "C"
import "os"
import "io"
import "log"
import "bufio"
import "strings"
package main
// #include <stdlib.h>
// #include <lua5.1/lua.h>
// #include <lua5.1/lualib.h>
// #include <lua5.1/lauxlib.h>
// #cgo LDFLAGS: -llua5.1
import "C"
import "unsafe"
package main
import "syscall"
import "log"
import "runtime"
import "flag"
import "fmt"
import "strconv"
import "os"
import "os/signal"