Skip to content

Instantly share code, notes, and snippets.

View babyking's full-sized avatar

Baby King babyking

View GitHub Profile
@n8henrie
n8henrie / txt_to_reminders.applescript
Last active March 11, 2024 17:04
Demonstration of using AppleScript with Reminders.app
--taken from http://benguild.com/2012/04/11/how-to-import-tasks-to-do-items-into-ios-reminders/#comment-1346894559
--set theFileContents to (read file "Users:n8henrie:Desktop:Reminders.txt") -- Change this to the path to your downloaded text file with your tasks in it! (Note the : instead of a / between folders) Or, just name them Reminders.txt and put them in your downloads folder
--set theLines to paragraphs of theFileContents
set theLines to {"task name 1", "task name 2"}
repeat with eachLine in theLines
tell application "Reminders"
set mylist to list "Your List Name"
tell mylist
make new reminder at end with properties {name:eachLine, due date:date "7/10/2014 3:00 PM"}
@csharpforevermore
csharpforevermore / AuthoHotKeyList.txt
Created April 27, 2014 15:50
AutoHotKey Key List
Key Name Resulting Keystroke
{F1} - {F24} Function keys. For example: {F12} is the F12 key.
{!} !
{#} #
{+} +
{^} ^
{{} {
{}} }
{Enter} ENTER key on the main keyboard
{Escape} or {Esc} ESCAPE
@quietcricket
quietcricket / Global keyboard hook for OSX
Created January 8, 2014 07:42
OSX global keyboard hook. Requires root privileges.
// alterkeys.c
// http://osxbook.com
//
// Complile using the following command line:
// gcc -Wall -o alterkeys alterkeys.c -framework ApplicationServices
//
// You need superuser privileges to create the event tap, unless accessibility
// is enabled. To do so, select the "Enable access for assistive devices"
// checkbox in the Universal Access system preference pane.
@babyking
babyking / private.xml
Last active December 14, 2015 07:49 — forked from lucifr/private.xml
keyremap4macbook配置文件.主要将capslock键映射到一个虚拟键F19, 以这个F19做最终的功能键扩展. 与目前的ctrl shift option command自带的组合快捷键,均不冲突!
<root>
<!--
<devicevendordef>
<vendorname>thinkpad_trackpoint</vendorname>
<vendorid>0x17ef</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>my_thinkpad_trackpoint</productname>
<productid>0x6009</productid>
</deviceproductdef>
@dcunited001
dcunited001 / keyremap.applescript
Created December 6, 2012 19:53
Applescript to Reload KeyRemap4MacBook Private.xml
on run {input, parameters}
--version >= 7.99.5
--use "launch application" step instead
--tell application "KeyRemap4MacBook" to activate
tell application "System Events"
--version >= 7.99.5
tell application process "KeyRemap4MacBook"
@jerray
jerray / Keyremap4MacBook_private.xml
Created August 26, 2012 07:35
KeyRemap4MacBook的自定义键位映射
<?xml version="1.0"?>
<root>
<item>
<name>7lemon custom settings</name>
<!--
互换option键和command键(虚拟机和远程桌面除外)
外接键盘用。可配合"General"中的"Don't remap Apple's keyboards"使用
-->
<item>
<name>Swap Option_L and Command_L</name>
@nrk
nrk / command.txt
Created April 2, 2012 19:19
Using ffprobe to get info from a file in a nice JSON format
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@andyfowler
andyfowler / .vimrc
Created September 5, 2011 18:08
Swap iTerm2 cursors in vim insert mode when using tmux
" tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif