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
(defun isearch-anywhere () | |
(interactive) | |
(save-excursion | |
(beginning-of-buffer) | |
(isearch-forward))) | |
(global-set-key (kbd "C-s") 'isearch-anywhere) |
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
(* | |
Getting Lyrics | |
by myfreeweb | |
thanks to pepelsbey for "Year to Album Sort", based on it | |
*) | |
tell application "iTunes" | |
set sel to selection | |
if sel is not {} then | |
set ofi to fixed indexing |
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
;;; Refreshing Safari on save, Mac only | |
;; Don't forget to enable assistive devices access | |
;; in System Preferences -> Universal Access | |
(if (featurep 'aquamacs) | |
(add-hook 'after-save-hook | |
'(lambda () | |
(when (string-match "\.html$" (buffer-name)) | |
(do-applescript (concat "tell application \"Safari\" | |
if \"file://" buffer-file-name "\" = URL of document 1 then | |
activate |
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
(defun coda-swap (expr) | |
(interactive "sExpr: ") | |
(query-replace-regexp | |
(replace-regexp-in-string "$[1-2]" "\\\\([0-9a-zA-Z]*\\\\)" expr) | |
(replace-regexp-in-string "$[1-2]" (lambda (m) (if (equal m "$1") "\\\\2" "\\\\1")) expr))) | |
;; Example: | |
; enter | |
; width="$1" height="$2" | |
; and it will replace |
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
# If you've just missed your 12345th tweet.. | |
# Getting it, the Python one-line way ^^ | |
# By myfreeweb <[email protected]>. | |
# Follow me on Twitter: @myfreeweb in English, @myfreeweb_ru in Russian. | |
import json | |
import urllib2 | |
# Imports don't count! | |
# We get 12344th tweet because Python counts from 0 and Twitter - from 1. Twitter loves humans :D | |
print json.loads(urllib2.urlopen('http://api.twitter.com/1/statuses/user_timeline.json?screen_name=myfreeweb&count=200').read())[json.loads(urllib2.urlopen('http://api.twitter.com/1/statuses/user_timeline.json?screen_name=myfreeweb&count=2').read())[0]['user']['statuses_count']-12344] |
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 | |
# Small script that updates version controlled subdirs. | |
# Awesome for your django apps or jquery plugins collection. | |
# By myfreeweb <[email protected]> | |
# Licensed under Do The Fuck What You Want License. | |
upd_tmpl="Updating with"; | |
find_opts="-maxdepth 1 -mindepth 1 -type d"; | |
root=`pwd`/; |
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
==> Build Environment | |
CC: /usr/bin/cc | |
CXX: /usr/bin/c++ | |
LD: /usr/bin/cc | |
CFLAGS: -O3 -march=prescott -mfpmath=sse -w -pipe | |
CXXFLAGS: -O3 -march=prescott -mfpmath=sse -w -pipe | |
MAKEFLAGS: -j2 | |
PATH: /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin | |
==> Cloning git://repo.or.cz/MacVim.git | |
Updating /Library/Caches/Homebrew/macvim-HEAD |
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
(add-to-list 'load-path "~/Dropbox/emacs") | |
(load-file "~/Dropbox/emacs/config.el") |
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
TypeError: Object #<a ServerResponse> has no method 'end' | |
at Server.<anonymous> (/Users/myfreeweb/Documents/test.js:6:9) | |
at /usr/lib/node/libraries/http.js:450:23 | |
at ServerSideConnection.<anonymous> (/usr/lib/node/libraries/http.js:373:37) | |
at node.js:845:9 |
NewerOlder