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 | |
use open qw(:std :utf8); | |
# Program to filter Wikipedia XML dumps to "clean" text consisting only of lowercase | |
# letters (a-z, converted from A-Z), and spaces (never consecutive). | |
# All other characters are converted to spaces. Only text which normally appears | |
1 #!/usr/bin/perl | |
# in the web browser is displayed. Tables are removed. Image captions are | |
# preserved. Links are converted to normal text. Digits are spelled out. |
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/env bash | |
insert () { | |
echo -e "$2" | pass insert --multiline -f "${1}" > /dev/null | |
} | |
sanitize () { | |
local res=$(echo "$1" | tr -d \'\"\!\(\)) | |
echo "$res" | |
} |
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
{-# LANGUAGE MagicHash #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module MyCollections where | |
import Java |
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
r2d2➜ /tmp cat foo.php && php foo.php | |
<?php | |
$value = 1; | |
$some_object = new stdClass; | |
var_dump((int)$some_object); | |
var_dump($value == $some_object); | |
</script> | |
========== | |
PHP Notice: Object of class stdClass could not be converted to int in /tmp/foo.php on line 4 | |
int(1) |
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
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"io/ioutil" | |
"log" | |
"net" | |
"net/http" | |
"strconv" |
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
wirelessimagewidget = widget({ type = 'imagebox', align='right' }) | |
wirelessimagewidget.image = image(beautiful.widget_wifi) | |
wirelesswidget = widget({ name = 'wireless', type = 'textbox', align = 'right' }) | |
function wireless_status(format) | |
local sysfile = io.open("/sys/class/net/wlan0/operstate") | |
if sysfile == nil then | |
return { '' } | |
end | |
local operstate = sysfile:read() |
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
#!/bin/bash | |
until [ -S ~/.awesome_ctl.0 ] ; do | |
sleep 1 | |
done | |
while [ -S ~/.awesome_ctl.0 ] ; do | |
echo gmailwidget.text = `wget -qO- --http-user=username --http-password=password https://mail.google.com/mail/feed/atom | grep fullcount | sed 's/<fullcount>\(.*\)<\/fullcount>/\1/'` | awesome-client | |
sleep 300 | |
done |
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
set nocompatible | |
set expandtab | |
set shiftwidth=4 | |
set softtabstop=4 | |
set tabstop=4 | |
set backspace=indent,eol,start | |
set t_Co=256 | |
set number | |
set autoindent | |
set smartindent |
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
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
battery_id='BAT0' | |
else | |
battery_id=$1 | |
fi | |
battery_max=`cat /proc/acpi/battery/$battery_id/info | head -3 | tail -1 | awk '{print $4}'` | |
if [ "$(cat /proc/acpi/battery/$battery_id/state | grep -o discharging)" == "discharging" ]; then | |
prepend="-" | |
else |
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
### Keybase proof | |
I hereby claim: | |
* I am amir on github. | |
* I am gluegadget (https://keybase.io/gluegadget) on keybase. | |
* I have a public key whose fingerprint is F3EF 9704 6BE4 440F 70D4 D01B B7D6 616C 564F 3388 | |
To claim this, I am signing this object: |