Skip to content

Instantly share code, notes, and snippets.

View tavisrudd's full-sized avatar

Tavis Rudd tavisrudd

View GitHub Profile
@igrigorik
igrigorik / github.bash
Last active December 22, 2023 23:55
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep git@github.com | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
@wolever
wolever / git-safemerge
Last active October 22, 2022 07:23
git-safemerge performs a "safer" merge, confirming the commits to be merged and the changes to be made before starting the commit process.
#!/bin/bash
# Performs a "safe" merge, confirming the commits to be merged, the merge
# strategy, any conflicts, etc.
# Useage:
# $ git safemerge master
# Commits:
# * bc911ef Fix bug in widget
# * e80f8d1 Clean things up
#
# Changes:
{-# LANGUAGE TemplateHaskell #-}
module Main
where
import System.Environment (getArgs)
import Data.ByteString.Char8 (pack)
import Control.Distributed.Process (say, Process, spawnLink, RemoteTable)
import Control.Distributed.Process.Node (newLocalNode, initRemoteTable, runProcess, localNodeId, LocalNode(..))
import Control.Distributed.Process.Internal.Types (NodeId(..))
@hadley
hadley / s3.r
Created May 7, 2013 13:16
Implementation of request signing for Amazon's S3 in R.
library(httr)
library(digest)
library(XML)
s3_request <- function(verb, bucket, path = "/", query = NULL,
content = NULL, date = NULL) {
list(
verb = verb,
bucket = bucket,
path = path,
@cemerick
cemerick / browser_repl.clj
Last active December 14, 2015 13:08
browser-REPL refactoring
;; ## Changes from cljs.repl.browser
;;
;; * Multiple concurrent browser-REPLs can be safely used
;; * The browser-REPL's HTTP server is now always-on
;; * Each browser-REPL session supports a new top-level "entry" URL that
;; can be used to easily start the REPL in a browser or other JS runtime
;; (i.e. you don't need to have a separate webapp running to initiate the
;; browser-REPL connection)
;; * The entry (and REPL) URLs are available in slots on the browser-REPL's
;; environment, making it trivial to automate browser-REPL sessions
@johnnyelwailer
johnnyelwailer / keyboard_navigation_service.js
Last active July 6, 2016 10:47
keyboard navigation directive / service in angular js (depends on jq and rxjs)
angular.module('keyboard', [])
.factory('keyboardNavigation', function () {
var keyboardContextStack = [];
var navigatables = {};
var activeIndex = 0;
return {
active: null,
register: function (scope, events) {
anonymous
anonymous / app.cljs
Created January 7, 2013 16:45
Came up last night with the Deferred (a.k.a Promise) monad in Clojurescript. In this specific code is being used to get IndexedDB instances and properties.
(ns indexeddb.app
(:require [goog.async.Deferred :as Deferred_]
[indexeddb.core :refer [m-bind
-promise
db-version
create-object-store
get-db]])
(:require-macros [indexeddb.macros
@rtrcolin
rtrcolin / jiraRefreshTickets.js
Last active January 8, 2024 13:59
Super simple Google Docs integration with Jira Issues/Tickets
// URL for Jira's REST API for issues
var getIssueURL = "https://[Your Jira host]/rest/api/2/issue/";
// Personally I prefer the script to handle request failures, hence muteHTTPExceptions = true
var fetchArgs = {
contentType: "application/json",
headers: {"Authorization":"Basic [Your BASE64 Encoded user:pass]"},
muteHttpExceptions : true
};
@doitian
doitian / org-pomodoro.el
Last active February 3, 2018 12:59
org-pomodoro: estimate using # pomodoro, see clocksum using # pomodoro, show timer in modelline TODO: make it a package
(defvar org-pomodoro-minutes 25)
(defvar org-pomodoro-cancelling nil)
(defvar org-pomodoro-command (locate-file "pomodoro" exec-path))
(defun org-pomodoro-on-org-load ()
(push (cons "p" org-pomodoro-minutes) org-effort-durations)
(push '("Effort_ALL" . "1p 2p 3p 4p 5p 6p 7p 8p") org-global-properties)
(define-key org-mode-map "\C-c\C-x'" 'org-pomodoro-columns)
(define-key org-agenda-mode-map "\C-c\C-x'" 'org-pomodoro-agenda-columns))
@mathieue
mathieue / udp-multi-socat.sh
Created August 28, 2012 23:57
udp multiplexer with socat
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)