Skip to content

Instantly share code, notes, and snippets.

View Jaskirat's full-sized avatar

Jaskirat Jaskirat

View GitHub Profile
@ghoseb
ghoseb / download.sql
Last active December 11, 2015 08:08
Check out what was the first item that you ever downloaded on your Mac OS X
-- Open a SQLite shell by issuing the command below
-- sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV*
select LSQuarantineDataURLString from LSQuarantineEvent order by LSQuarantineTimeStamp asc limit 1;
-- For me, it's GNU Emacs.
-- sqlite> select LSQuarantineDataURLString from LSQuarantineEvent order by LSQuarantineTimeStamp asc limit 1;
-- http://bandwidth.porkrind.org/emacs-builds/Emacs-24.2-universal-10.6.8.dmg
@legumbre
legumbre / foo.md
Created June 29, 2012 00:14
resolving merge conflicts with magit-ediff

Use magit-ediff to resolve merge conflicts

Use magit-ediff or 'e' on an unmerged item to resolve merge conflicts with ediff. Magit will set up an ediff with three buffers A, B and C. A and B are the original (conflicting) files, and C is the conflicted merge.

Use 'n'/'p' to move to the next/previous conflict, use 'a'/'b' to choose which changes (those in a A or B) should be the ones to keep in the merged file.

You can always just switch to buffer C and edit what the merged version should look like.

@alandipert
alandipert / flp.clj
Created March 20, 2012 04:18
Function-level programming a la Backus
(ns flp
"Function-level programming a la Backus; see
http://www.stanford.edu/class/cs242/readings/backus.pdf"
(:refer-clojure :exclude [/]))
;;; Functional Forms - combine existing functions to form new ones.
(def ^{:doc "Composition"} ° comp)
(defn / [f]
@swannodette
swannodette / gist:1667847
Created January 24, 2012 04:40
hierarchy.clj
(ns hierarchy.core
(:refer-clojure :exclude [==])
(:use [clojure.core.logic]))
(def order [:domain :kingdom :phylum :class :order :family :genus :species])
(def homo-sapiens
{:domain :eukarya
:kingdom :animalia-metazoa
:phylum :chordata
@nathanmarz
nathanmarz / gist:1228302
Created September 20, 2011 04:01
Example of defining a topology in Clojure
(use 'backtype.storm.clojure)
(use 'backtype.storm.config)
(require '[backtype.storm [thrift :as thrift]])
(import 'storm.starter.spout.RandomSentenceSpout)
(import 'backtype.storm.LocalCluster)
(defboltfull suffix-bolt ["word"]
:params [suffix]
:let [conf-state (atom nil)]
:prepare ([conf context collector]
; A solution to https://4clojure.com/problem/102 that doesn't involve cl-format
#(clojure.string/replace % #"-." (fn [m] (-> m last Character/toUpperCase str)))
(require 'iimage)
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)
(add-to-list 'iimage-mode-image-regex-alist '("@startuml\s+\\(.+\\)" . 1))
;; Rendering plantuml
(defun plantuml-render-buffer ()
(interactive)
(message "PLANTUML Start rendering")
(shell-command (concat "java -jar ~/Downloads/plantuml.jar "