Skip to content

Instantly share code, notes, and snippets.

View ashkrosh's full-sized avatar

Ashkan Roshanayi ashkrosh

View GitHub Profile
@ashkrosh
ashkrosh / .surfingkyes.js
Last active March 25, 2025 09:22
surfingkyes
const {
aceVimMap,
mapkey,
imap,
imapkey,
getClickableElements,
vmapkey,
map,
unmap,
@ashkrosh
ashkrosh / labelchanger.scpt
Created August 6, 2020 18:57
Update all email labels in macos contacts to a custom label
-- Pipedrive smart data collection only works on emails labeled as "Work" so I changed all labels to Work.
tell application "Contacts"
activate
set (label of emails of people whose label is not "Work") to "Work"
save
end tell
on alfred_script(q)
set startIt to false tell application "System Events" if not (exists process "kitty") then set startIt to true else if not (frontmost of process "kitty") then set frontmost of process "kitty" to true set visible of process "kitty" to true tell application "System Events" to key code 126 using {option down, command down} end if end tell if startIt then tell application "kitty" to activate end if
end alfred_script
@ashkrosh
ashkrosh / delete all Contacts groups
Created April 20, 2017 14:56
delete all Contacts groups
tell application "Contacts"
set theGroupNames to name of groups
repeat with i from 1 to number of items in theGroupNames
try
set groupName to item i of theGroupNames
set theGroup to group groupName
delete theGroup
on error
exit repeat
end try
@ashkrosh
ashkrosh / gist:c6b92f4a0b8815546796c851ed3f99bb
Last active August 3, 2016 08:35 — forked from mtheoryx/gist:3286362
Set Microsoft Lync status with applescript
tell application "Microsoft Lync"
activate
end tell
tell application "System Events"
tell process "Microsoft Lync"
tell menu bar 1
tell menu bar item "Status"
tell menu "Status"
click menu item "Be Right Back"
@ashkrosh
ashkrosh / TextExpander to Text Shortcuts.applescript
Created December 15, 2015 15:39 — forked from Zettt/TextExpander to Text Shortcuts.applescript
TextExpander Snippet to iOS/OS X Text Shortcuts. Read more: http://tmblr.co/ZFavEy-uZJ-M
set clickDelay to 0.3
set abbreviationList to {}
set snippetsList to {}
set disallowedGroups to {"AutoCorrect", "AutoCorrect Deutsch Snippets", "AlteNeue Rechtschreibung", "Deutsche Akronyme"}
set disallowedSnippetContents to {"%e", "%d", "%a", "%A", "%m", "%1m", "%b", "%B", "%y", "%Y", "%H", "%I", "%1H", "%1I", "%M", "%1M", "%S", "%1S", "%p", "%@+", "%@-", "%key:", "%clipboard", "%|", "%<", "%^", "%>", "%v", "%-", "%+", "%fill:", "%fillpart:", "%filltext:", "%fillpopup:", "%fillarea:"}
-- open the Text tab of Keyboard preferences
tell application "System Preferences"
activate
delay 5
@ashkrosh
ashkrosh / reset.css
Created April 28, 2012 14:42
Eric Meyer's css reset (html5 compatible)
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@ashkrosh
ashkrosh / fix-rvm.sh
Created April 3, 2012 09:21
Create symbolic links for rvm goodies in my Mac OS setup
for f in `ls ~/.rvm/bin/ | grep -G "rvm" -v`; do ln -sF $f; done
@ashkrosh
ashkrosh / deploy_django.sh
Created February 12, 2012 08:05
simplest deploy script for a django project
#!/bin/bash -ex
cd $WORKSPACE
virtualenv -q ve
source ./ve/bin/activate
pip install -E ./ve -r requirements.txt
pip install -E ./ve -r requirements-testing.txt
cd $WORKSPACE/projectname
ln -fs `pwd`/conf/testsettings.py `pwd`/localsettings.py
python manage.py migrate
python manage.py jenkins