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 rusz-fix() | |
(interactive) | |
(fix-hackz0rs "\\(<\\)cfhttp .*rusztiko.com.* />\\s-+<cfset html = cfhttp.FileContent />\\s-+<cfoutput>#html#</cfoutput>")) | |
(define-key global-map (kbd "<f1>") 'rusz-fix) | |
(defun fix-hackz0rs(regex) | |
(interactive) | |
(require 'ffap) | |
(window-configuration-to-register :hackz0rs) |
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
;; required or gtfo | |
(add-hook 'php-mode-hook (lambda() | |
(setq indent-tabs-mode nil) | |
(setq tab-width 2) | |
(setq c-basic-offset 2))) | |
(add-hook 'before-save-hook 'whitespace-cleanup) | |
(require 'align) | |
(add-to-list 'align-rules-list |
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
;; no longer having to manually delete other windows when | |
;; inspecting variables in geben | |
(require 'geben) | |
(defadvice geben-display-context (before max-windows) | |
(delete-other-windows)) | |
(ad-activate 'geben-display-context) |
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
(defadvice magit-status(after enable-magit-svn-mode activate) | |
"Enable `magit-svn-mode' when opening magit via `magit-status' | |
and is a git svn repository." | |
(require 'magit-svn) | |
(when (magit-svn-get-ref-info) | |
(turn-on-magit-svn))) |
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
(defadvice magit-status(after enable-magit-svn-mode activate) | |
"Enable `magit-svn-mode' when opening magit via `magit-status' | |
and is a git svn repository." | |
(require 'magit-svn) | |
(when (magit-svn-get-ref-info) | |
(turn-on-magit-svn))) | |
;; or.. | |
(add-hook 'magit-mode-hook (lambda() |
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
(defvar magit-svn-externals-dir ".git_externals") | |
(defun magit-svn-fetch-externals() | |
"Loops through all external repos found by `magit-svn-get-externals' | |
and runs git svn fetch, and git svn rebase on each of them." | |
(interactive) | |
(let ((externals (magit-svn-get-externals))) | |
(if (not externals) | |
(message "No SVN Externals found. Check magit-svn-externals-dir.") | |
(dolist (external externals) |
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 buffer-cleanup() | |
(interactive) | |
(buffer-cleanup-safe) | |
(indent-region (point-min) (point-max))) | |
(defun buffer-cleanup-safe() | |
"Unless its a markdown file, do some cleaning up." | |
(interactive) | |
(unless (and (buffer-file-name) | |
(string-equal (file-name-extension (buffer-file-name)) "md")) |
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
from fabric.operations import local | |
from fabric.context_managers import cd, lcd | |
repo = raw_input("URL: ") | |
dest_dir = raw_input("Dest Dir: ") | |
local("mkdir -p " + dest_dir) | |
local("git svn clone --stdlayout %(url)s %(dest)s" % { "url": repo, | |
"dest": dest_dir }) |
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
(with-temp-buffer | |
(insert-file-contents (concat (wp/exists) wp/config-file)) | |
(goto-char (point-min)) | |
(while (search-forward-regexp "define\s*(\s*['\"]\\(DB_\\(HOST\\|NAME\\|PASSWORD\\|USER\\)\\)['\"]\s*,\s*['\"]\\([^'\"]*\\)['\"]\s*)" nil t) | |
(add-to-list 'db-credentials `(,(match-string 1) . ,(match-string 3))))) |
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/local/bin/python | |
import requests | |
import re | |
import json | |
from BeautifulSoup import BeautifulSoup | |
from BeautifulSoup import BeautifulStoneSoup | |
s = requests.session() |