Skip to content

Instantly share code, notes, and snippets.

View nabinno's full-sized avatar
🤞
Draw and draw and draw

nabinno

🤞
Draw and draw and draw
View GitHub Profile
(defun mycal (foo bar)
(interactive)
(concatenate 'string
"top:"
(format nil "~s" (- foo 111))
"px;"
(format nil "~%")
"left:"
(format nil "~s" (- bar 370))
"px;"))
(dotimes (i 100)
(print
(concatenate 'string "y_" (format nil "~s" i))))
;; OR
(dotimes (i 100)
(print
(substitute-string (format nil "~s" i) "^" "y_")))
@nabinno
nabinno / mtml-example.xml
Created September 16, 2014 01:49
MTML: A NAND B = NOT A AND B
<mt:Entries tags="NOT foo AND bar">blur blur blur</mt:Entries>
function vlookup-symbol () {
ls -al $1 | awk '{print "echo", $9, $11}' | sh | while read C1 C2
do
if [ ${C2} = "$2" ]
then
echo ${C1}
break
fi
done
}
@nabinno
nabinno / get-forward-email-in-sakura-rental
Last active August 29, 2015 14:06
How to get the list of foward email addreses in Sakura Rental
$ pr /home/foo/MailBox/*/.mailfilter > bar.txt
@nabinno
nabinno / rsync-example-of-different-from-cygwin-and-freebsd.sh
Created September 16, 2014 03:11
Rsync different from Cygwin and FreeBSD:
# Cygwin:
function put-rsync () {
 rsync \
  —verbose \
  —exclude=.old \
  —exclude=consul/* \
  —exclude=cgi-bin \
  —exclude=link/* \
  —delete \
  —checksum \
@nabinno
nabinno / find-find-file
Created September 25, 2014 01:56
find-find-file aka yet another find-file for eshell
alias find-find-file for i in {find $*} {find-file $i}
def prime_number(number)
container = [1]
ary = (2..number).to_a
tmp = ary.shift
while tmp
ary.delete_if { |i| i % tmp == 0 }
container << tmp
tmp = ary.shift
end
#!/usr/bin/env ruby1.9
class Class
def descendants
ObjectSpace.each_object(::Class).select {|klass| klass < self }
end
end
sudo apt-get update
sudo apt-get -y purge scala-library scala sbt
sudo apt-get -y remove scala-library scala sbt
sudo apt-get -y purge openjdk-\* icedtea-\* icedtea6-\*
apt-cache search java | awk '{print($1)}' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e 'java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove
dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge
sudo rm -rf /usr/lib/jvm