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
(defun update-anybar-color (color &optional port) | |
(shell-command | |
(format "echo -n \"%s\" | nc -4u -w0 localhost %s" | |
color (or port 1738)))) | |
;; (update-anybar-color "red") |
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
tell application "Google Chrome" | |
repeat with current_tab in (tabs of front window) | |
set has_vk_player_mark to execute current_tab javascript "!!document.getElementById('gp')" | |
if has_vk_player_mark then | |
if URL of current_tab contains "vk.com" and has_vk_player_mark then | |
set URL of current_tab to "javascript:audioPlayer.nextTrack();" | |
end if | |
end if | |
end repeat | |
end tell |
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
(setq | |
chrome-vk-player-base | |
"tell application \"Google Chrome\" | |
repeat with current_tab in (tabs of front window) | |
set has_vk_player_mark to execute current_tab javascript \"!!document.getElementById('gp')\" | |
if has_vk_player_mark then | |
if URL of current_tab contains \"vk.com\" and has_vk_player_mark then | |
%s | |
end if | |
end if |
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
# -*- coding: utf-8 -*- | |
# name: cgd | |
# -- | |
# coding: utf-8 | |
""" | |
`(let* ((relative_p (f-relative (buffer-file-name) (vc-git-root (buffer-file-name)))) | |
(package_name (s-replace "/" "." (s-replace ".py" "" relative_p)))) | |
(format "%s\n%s\n%s\n" | |
(s-repeat (length package_name) "=") |
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
(ns cltrace.example | |
(:require [clojure.core.async :refer [<! >! >!! chan go-loop]])) | |
(def queue (atom [])) | |
(defn process-chan [in] | |
(let [out (chan)] | |
(go-loop [item (<! in)] | |
(swap! queue conj item) | |
(when (> (count @queue) 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
;; Prodigy app and services | |
(defconst prodigy-python-apps | |
'(airborne airborne-gunicorn airborne-celery airborne-hyattfast bowman cessna fokker fasttrace)) | |
(defconst prodigy-standard-python-service | |
'((airborne :args ("manage.py" "runserver" "5000")) | |
(airborne-gunicorn | |
:command "gunicorn" | |
:args ("wsgi:application" "-c" "gunicorn_conf.py" "--log-file=-")) | |
(airborne-celery |
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
(setq | |
scripts-dired-find-owner | |
"tell application \"Finder\" | |
set appname to (default application of (info for POSIX file \"%s\")) | |
do shell script \"echo \" & appname | |
end tell") | |
(setq | |
scripts-dired-open-from-finder |
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
;; /src/jiracli/web.clj | |
(ns jiracli.web | |
(:require [com.stuartsierra.component :as component] | |
[ring.component.jetty :refer [jetty-server]]) | |
(:gen-class)) | |
(defn app-handler | |
"Main application server." | |
[request] |
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
(ns logprocessor.core | |
(:require [clojure.java.io :as io] | |
[clojure.zip :as zip] | |
[clojure.data.xml :as xml] | |
[clojure.data.zip.xml :as zx]) | |
(:gen-class)) | |
(def store "/Users/rmuslimov/projects/logs/d=12") | |
(defn get-zipper |
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
import os | |
from datetime import datetime | |
from lxml import etree | |
def import_file(filename): | |
with open(filename) as f: | |
body = etree.fromstring(f.read()) | |
return etree.ETXPath( |
OlderNewer