Skip to content

Instantly share code, notes, and snippets.

View zmughal's full-sized avatar
🌿
fiddling with attribute grammars.

Zaki Mughal [sivoais] zmughal

🌿
fiddling with attribute grammars.
View GitHub Profile
#!/bin/sh
sudo apt-get install gir1.2-clutter-1.0 gir1.2-champlain-0.12 --no-install-recommend
#!/bin/sh
#DISPLAY=:0
SIZE="1024x700"
SCREEN_HEIGHT=`xrandr -q | grep '*' | head -1 | grep -o 'x[0-9]\+' | grep -o '[0-9]\+'`
if [ "$SCREEN_HEIGHT" = "1024" ]; then
SIZE="1280x1000"
fi
Xephyr -screen "$SIZE" :1 &
sleep 3
@zmughal
zmughal / colonop.m
Last active September 12, 2015 23:25 — forked from astrojuanlu/colonop.m
MATLAB colon operator source code, obtained from http://www.mathworks.com/support/solutions/attachment.html?resid=1-4FLIOY&solution=1-4FLI96 as of 2013-11-09.
function v = colonop(a,d,b)
% COLONOP Demonstrate how the built-in a:d:b is constructed.
%
% v = colonop(a,b) constructs v = a:1:b.
% v = colonop(a,d,b) constructs v = a:d:b.
%
% v = a:d:b is not constructed using repeated addition. If the
% textual representation of d in the source code cannot be
% exactly represented in binary floating point, then repeated
% addition will appear to have accumlated roundoff error. In
#!/usr/bin/env bash
usage() { cat <<- DOCUMENT
$PROGNAME [-h] [-t] [-k key] [-l login] [server]
Utility for automatically exporting ssh keys into remote servers for authentication.
Checks $HOME/.ssh for id_rsa.pub or id_dsa.pub and appends them into
the authorized_keys of remote host
AUTHOR: Sang Han
Iteration is a pesky thing...it makes your algorithms slow. So what if I could
calculate factorials without iteration?
Save the following in a file, `chmod a+x` it and run like `./fact.pl 5`
Just don't pass in negative numbers or you'll slowly use up system resources.
@zmughal
zmughal / DOC-LOOKUP-README.md
Last active August 29, 2015 14:09
Documentation lookup scripts

Scripts to look up program documentation.

#!/usr/bin/env perl
use v5.16;
no strict; # DANGER
no warnings;
# 43 + 10 = 53
say"Happy birthday to ".($_-2?you:programmer)for+0..3
;
all: libtowel.so
perl towel.pl
-@#LD_PRELOAD="`pwd`/libtowel.so" perl towel.pl
libtowel.so: towel.c
$(CC) -shared -fPIC -o $@ $<
clean:
rm -Rf _Inline/ libtowel.so
DateTime does stringify
2014-06-29T21:49:50
----
PDL does not stringify
0