Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@exu
exu / foo.md
Created November 22, 2012 14:23 — forked from legumbre/foo.md
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.

@sabof
sabof / javascript-imenu.el
Last active December 13, 2015 16:39
javascript function lookup
(defun es-js-imenu-create-index ()
"Return an imenu index for the current buffer."
(save-excursion
(save-restriction
(let (unique-names result name pos)
(widen)
(goto-char (point-min))
(while (re-search-forward
(concat "\\(\\_<.+?\\_>\\) = function"
"\\|"
@exu
exu / .ctags
Created April 22, 2013 12:14
My Emacs .ctags config file for PHP 5.4 based projects. Save it in project directory. (It needs exuberant-ctags package). I'm using it with etags-select package
-e
-f ./TAGS
--recurse
--languages=PHP
--exclude=.svn
--exclude=.git
--exclude="*/_*cache/*"
--exclude="*/_*logs{0,1}/*"
--exclude="*/_*data/*"
--totals=yes
@koemeet
koemeet / Vagrantfile
Last active May 8, 2016 10:42
Vagrant setup for docker (Mac + Win supported)
# UI Object for console interactions.
@ui = Vagrant::UI::Colored.new
# Install required plugins if not present.
required_plugins = ["vagrant-triggers", "vagrant-gatling-rsync"]
required_plugins.each do |plugin|
need_restart = false
unless Vagrant.has_plugin? plugin
system "vagrant plugin install #{plugin}"
need_restart = true
@eyemyth
eyemyth / config.txt
Last active July 11, 2017 08:32 — forked from anonymous/gist:8983191
/boot/config.txt to make raspberry pi run at 1080p
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
@attentive
attentive / leaflet.cljs
Last active September 16, 2017 09:25
Adapting React components in Rum
(ns project.leaflet
(:require-macros [project.macros :as m])
(:require [rum.core :as rum]
cljsjs.react-leaflet)) ;; js/ReactLeaflet
(m/adapt-react leaflet-map js/ReactLeaflet.Map)
(m/adapt-react tile-layer js/ReactLeaflet.TileLayer)
(m/adapt-react marker js/ReactLeaflet.Marker)
(m/adapt-react popup js/ReactLeaflet.Popup)
@scttnlsn
scttnlsn / core.cljs
Created July 1, 2015 17:58
Reagent/Secretary nested routing
(ns nested-routing.core
(:require [goog.events :as events]
[goog.history.EventType :as EventType]
[reagent.core :as reagent]
[reagent.ratom :refer-macros [reaction]]
[re-frame.core :refer [dispatch dispatch-sync register-handler register-sub subscribe]]
[secretary.core :as secretary :refer-macros [defroute]])
(:import goog.History))
(declare route-components
@vbedegi
vbedegi / react-sortable-hoc-in-reagent.cljs
Last active November 29, 2017 15:50
using react-sortable-hoc in reagent
(def react-sortable-hoc (aget js/window "deps" "react-sortable-hoc"))
(defn make-sortable-element-component [wrapped-component]
(let [sortable-element-factory (.-SortableElement react-sortable-hoc)]
(-> wrapped-component
r/reactify-component
sortable-element-factory
r/adapt-react-class)))
(defn make-sortable-container-component [wrapped-component]
(ns shell
(:require [me.raynes.conch.low-level :as sh]
[slingshot.slingshot :refer [throw+ try+]]
[clojure.core.async :refer [go alts!!]]
[clojure.string :as str])
(:import (java.io IOException StringWriter)
(java.util.concurrent ExecutionException)))
(defn start-step! [upstream step]
(let [prev-step (-> upstream last)