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
#!/bin/sh | |
lock(){ | |
i3lock | |
} | |
case "$1" in | |
lock) | |
lock | |
;; | |
logout) |
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
#!/bin/bash | |
LOCKDIR=/home/path/to/lock.png | |
scrot -e 'convert -blur 0x3 $f ~/lockbg.png;rm $f' | |
convert -gravity center -composite ~/lockbg.png $LOCKDIR/lock.png ~/lockfinal.png | |
i3lock -u -i ~/lockfinal.png | |
rm ~/lockfinal.png ~/lockbg.png |
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
#!/usr/bin/env bash | |
icon="$HOME/path/to/lock.png" | |
tmpbg='/tmp/screen.png' | |
(( $# )) && { icon=$1; } | |
scrot "$tmpbg" | |
convert "$tmpbg" -scale 10% -scale 1000% "$tmpbg" | |
convert "$tmpbg" "$icon" -gravity center -composite -matte "$tmpbg" |
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
1.upto(100){|n|puts n%15==0?"FizzBuzz":n%5==0?"Buzz":n%3==0?"Fizz":n} |
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
#! /usr/bin/env ruby | |
if ARGV.empty? | |
puts "Please enter a file name" | |
exit | |
end | |
out_file = File.new("out.txt", "w+") | |
puts "Appending to output file..." |
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
#!/usr/bin/python2 | |
import os, urllib | |
google = os.popen('zenity --entry --text="Enter your search: " --title="goog.py"').read() | |
google = urllib.quote(google) | |
os.system('google-chrome-stable http://google.com/search?q=%s' % (google) ) |
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
#! /usr/bin/env ruby | |
if ARGV.empty? | |
puts "Please enter a file name" | |
end | |
new_file = ARGV[0] | |
org_file = File.new(new_file, "w+") | |
org_file.puts("#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"http://thomasf.github.io/solarized-css/solarized-light.min.css\" />\n") | |
org_file.puts("#+TITLE: \n") |
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
/* | |
Before using make sure you have: | |
npm install --save-dev gulp gulp-minify-css gulp-concat gulp-uglify gulp-autoprefixer gulp-sass | |
Make sure to change the directory names in the default watch function to the CSS/SCSS/SASS directories you are using so it reloads | |
*/ | |
var gulp = require('gulp'), | |
minifyCSS = require('gulp-minify-css'), | |
concat = require('gulp-concat') |
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
#! /bin/bash | |
process=$1 | |
ps cax | grep $process > /dev/null | |
if [ $? -eq 0 ]; then | |
echo "process is running" | |
else | |
echo "process is not running" | |
fi |
OlderNewer