Skip to content

Instantly share code, notes, and snippets.

View gabesoft's full-sized avatar

Gabriel Adomnicai gabesoft

  • Quip
  • San Francisco
View GitHub Profile
@ryanflorence
ryanflorence / static_server.js
Last active April 26, 2024 16:18
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@dmkash
dmkash / br.sh
Created April 10, 2012 22:44
Shell Script for tmux setup
#!/bin/sh
SESSION_NAME="big_red"
cd ~/Sites/within3/big_red
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
@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.

@tylevad
tylevad / xmonad.hs
Last active November 3, 2023 23:14
XMonad window manager config
{-# LANGUAGE TypeSynonymInstances, DeriveDataTypeable, MultiParamTypeClasses, NoMonomorphismRestriction #-}
-- Ty Levad - tylevad@gmail.com
-- xmonad.hs
-- Core Modules
import System.Exit
import XMonad hiding ((|||))
import qualified XMonad.StackSet as W
-- Action Modules
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@Scorpil
Scorpil / emacs_ensime_scala.md
Created October 2, 2012 16:59
Using Emacs with Ensime for Scala development

This tutorial is tested on Debian linux. Should work on other platforms with minimal changes. This post really helped: http://jawher.net/2011/01/17/scala-development-environment-emacs-sbt-ensime/

  • Install jdk and sbt (more on that: https://class.coursera.org/progfun-2012-001/wiki/view?page=ToolsSetup)
  • Install scala-mode for Emacs:
    apt-get install subversion  # in case you don't have subversion already installed 
    svn export http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/emacs scala-emacs
    mkdir ~/.emacs.d/scala  # creating folder for scala extensions

mv scala-emacs ~/.emacs.d/scala # moving scala-mode to new folder

@i-e-b
i-e-b / Readme_NIX_OS.md
Last active July 4, 2023 16:53
/etc/nixos/configuration.nix

My experiments with an XMonad setup in NixOS. This is my work box now, so it pretty much works.

probably needs:

# useradd -m iain
# passwd iain ...
# passwd root ...
@jdoles
jdoles / logging.yml
Last active February 5, 2017 00:49
elasticsearch logging.yml with syslog
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: DEBUG
rootLogger: ${es.logger.level}, console, file, syslog
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN
# gateway
@runarorama
runarorama / gist:a8fab38e473fafa0921d
Last active April 13, 2021 22:28
Compositional application architecture with reasonably priced monads
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]