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
var typeIsArray; | |
typeIsArray = Array.isArray || function(value) { | |
return {}.toString.call(value) === '[object Array]'; | |
}; | |
typeIsArray([1,2,3]); |
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
var fs = require("fs"); | |
var a, b, split, | |
longest = '', | |
sequence = '', | |
output = '', | |
matched = 0, | |
matchpos = 0; | |
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function(line) { |
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
for i in `curl shedali.co.uk | grep -o -E 'href="([^"#]+)"' | cut -d '"' -f2 | sort | uniq`; do bash isup.sh $i; 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
#/bin/bash | |
regex=[0-9][0-9][0-9][0-9]-.*.\(md\|txt\); | |
inotifywait -m -e CREATE,DELETE,MOVE ~/Dropbox/note/ | | |
while read dir ev file; | |
do | |
if [[ $file =~ $regex ]] ; then echo "$file updated"; fi | |
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
#!/bin/bash | |
echo running; | |
find . -maxdepth 3 -regex ".*\-2016[0-9][0-9][0-9][0-9].*.*" | while read filename; | |
do | |
f=$(basename "$filename") | |
echo $f | |
date=$(echo "$f" | cut -c5-12) | |
echo $date | |
if echo "${date}" | grep '[0-9]' >/dev/null; then | |
dirpath='/Users/shedali/Dropbox/Events/2016/'${date:0:4}-${date:4:2}-${date:6:2} |
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
function expand_devtools() | |
hs.application.launchOrFocus("Google Chrome") | |
hs.application.launchOrFocus("Terminal") | |
hs.application.launchOrFocus("Sublime Text") | |
local laptopScreen = "iMac" | |
local windowLayout = { | |
{"Google Chrome", nil, iMac, {x=0, y=0, w=0.5, h=1},nil, nil}, | |
{"Sublime Text", nil, iMac, {x=0.5, y=0, w=0.5, h=0.6},nil, nil}, | |
{"Terminal", nil, iMac, {x=0.5, y=0.6, w=0.5, h=0.4},nil, nil}, | |
-- {"App Name", "Window Name", "Screen Name", hs.layout.left50,nil, nil} |
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
-- http://www.hammerspoon.org/go/ | |
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "R", function() | |
hs.reload() | |
hs.alert.show("Config loaded") | |
end | |
) | |
function expand_devtools() | |
hs.application.launchOrFocus("Slack") |
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
# javascript for mac - get OF flagged tasks | |
var of = Application('OmniFocus'); | |
var doc = of.defaultDocument; | |
getTasks(); | |
function getTasks(){ | |
var today = new Date(); | |
var dueDate = new Date(today.setDate(today.getDate()+7)); |
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
const runJxa = require("run-jxa"); | |
const _ = require('lodash'); | |
(async () => { | |
const result = await runJxa(() => { | |
var of = Application("OmniFocus"); | |
var doc = of.defaultDocument; | |
return getTasks(); |
OlderNewer