Skip to content

Instantly share code, notes, and snippets.

View edgargoncalves's full-sized avatar

Edgar Gonçalves edgargoncalves

  • https://www.businessdatapartners.com/
  • United Kingdom
View GitHub Profile
@edgargoncalves
edgargoncalves / gist:cd8c39dc9f5c05761bb4649691c3471d
Created February 20, 2021 11:53
darktable on BigSur - command line output
(base) ➜ ~ rm -rf .cache/darktable
(base) ➜ ~ rm -rf .cache/
(base) ➜ ~ brew install darktable
==> Downloading https://github.com/darktable-org/darktable/releases/download/release-3.4.1/darktable-3.4.1.dmg
Already downloaded: /Users/eemg/Library/Caches/Homebrew/downloads/32125799dceb00bee68724f51cd38ecc10559f0674c904980d69e66ca88a66a3--darktable-3.4.1.dmg
==> Installing Cask darktable
==> Moving App 'darktable.app' to '/Applications/darktable.app'
🍺 darktable was successfully installed!
(base) ➜ ~ /Applications/darktable.app/Contents/MacOS/darktable -d all
@edgargoncalves
edgargoncalves / groovesharkvideos.js
Created December 8, 2010 20:35
Userscript to search for videoclips of the currently playing song on youtube, on 'v' keypress
// ==UserScript==
// @name Grooveshark Videoclip lookup
// @namespace http://sites.google.com/site/edgargoncalves/
// @description Searches for videoclips of the currently playing song on youtube, on 'v' keypress
// @include http://listen.grooveshark.com/*
// ==/UserScript==
function getNowPlaying(e){
if (e.which === 86) { // 'v'
var row = $("#playerDetails_nowPlaying");
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; prepare our namespaces to the build-script:
(ns leiningen.deploy
(use [lancet :only [ant exec]] ; add other needed ant tasks here
[leiningen.uberjar :only [uberjar]] ; add other lein commands here
[leiningen.core :only [project]])) ; just so that we may call cmds
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; helper fns:
(defun slime-redirect-inferior-output (&optional noerror)
"Redirect output of the inferior-process to the REPL buffer."
(interactive)
(let ((proc (slime-inferior-process)))
(cond (proc
(let ((filter (slime-rcurry #'slime-inferior-output-filter
(slime-current-connection))))
(set-process-filter proc filter)))
(noerror)
(t ;; (error "No inferior lisp process")
;; Use of clojure-find-package suggested by Jürgen Hötzel
(defun slime-update-clojure-namespace (arg)
"Find the namespace in the current buffer and use SLIME's REPL
to switch to it, updating the namespace for all buffers.
Using an universal prefix will ask for the name of the namespace.
The actual namespace switch is done by calling `SLIME-REPL-SET-PACKAGE'."
(interactive "P")
(if arg
(call-interactively 'slime-repl-set-package)
(let ((ns (clojure-find-package))) ;; find the (in-ns ...) ns string
(defun slime-update-clojure-namespace (arg)
"Find the namespace in the current buffer and use SLIME's REPL
to switch to it, updating the namespace for all buffers.
Using an universal prefix will ask for the name of the namespace.
The actual namespace switch is done by calling `SLIME-REPL-SET-PACKAGE'."
(interactive "P")
(if arg
(call-interactively 'slime-repl-set-package)
(save-excursion
;; search for this buffer's namespace:
(require 'pc-select)
(defun slime-update-clojure-namespace ()
"Find the namespace in the current buffer and use SLIME's REPL
to switch to it, updating the namespace for all buffers."
(interactive)
(save-excursion
;; search for this buffer's namespace:
(goto-char 0)
(when (search-forward "(ns " nil t)
(let ((beg (point))
(ns clj-as.core
(:import [javax.script.ScriptEngine]
[javax.script.ScriptEngineManager]
[javax.script.ScriptEngineException]))
(defn order-itunes-to [command]
(let [mgr (javax.script.ScriptEngineManager.)
engine (.getEngineByName mgr "AppleScript")]
(.eval engine (str "tell application \"iTunes\" to " command))))
var pingTimer = null;
var pingServer = function () {
//make a background server request to a ping service
var x = $("<script/>", {src: "/servlet/ping"});
$("body").append(x);
x.remove();
};
var resetPingTimer = function () {
(defmacro with-local-user [& body]
`(try (.setUp (test/local-service-test-helper (LocalUserServiceTestConfig.)))
~@body
(finally
(test/tear-down))))
(defn wrap-with-gae-local-user-service
"Ring middleware method that wraps an application so that every request will have
a user-info map assoc'd to the request under the key :appengine/user-info."