Skip to content

Instantly share code, notes, and snippets.

View Momus's full-sized avatar

Dmitri Brengauz Momus

View GitHub Profile

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@Momus
Momus / hostname rDNS
Last active December 11, 2015 21:28
reverse DNS on a hostname
whois `ping -c 1 google.com | awk '/icmp/{sub(":" , "" , $4) ; print $4}'`
@Momus
Momus / gist:860d9a8c59b1948e154d
Created January 21, 2015 20:24
A little Emacs eshell magic
git rm $(git ls-files --deleted)
@Momus
Momus / MinitestDebug.rb
Last active August 29, 2015 14:21
Using Minitest assertions for debugging in Ruby on Rails
## When you
require 'test_helper'
## and create tests with, for example,
class UsersLoginTest < ActionDispatch::IntegrationTest
## In your
test "verify an important feature" do
## you can use assert statements to print out debugging info
@Momus
Momus / gist:ed3b5bab637b5391a0ea
Last active August 29, 2015 14:22
Bloody Prize

Bloody Prize

  • 1/2 lemon
  • 1 blood orange
  • Your entire purser's ration of @YourBlackMagic
  • As much light agave as needed to take drink from "buccaneer" to "cabin boy"

Squeeze into glass, ice, stir.

@Momus
Momus / davtools-test.el
Last active August 27, 2015 22:29
Run devtools::test_that on file save
(defun devtools-test ()
;;Run test_that on each save by Brian Malehorn
;;http://stackoverflow.com/questions/32257685/running-rdevtooltest-that-on-buffer-save-in-ess
(interactive)
(when
(let* ((old (current-buffer)))
(string-match (rx-to-string `(: ".R" eos) t) (buffer-name))
(switch-to-buffer "*R*")
(end-of-buffer)
(insert "devtools::test()")
@Momus
Momus / errors.txt
Last active March 22, 2016 22:35
Intro to Literate Programming by Howard Abrams possible errors
- Too Many Parameters?
error: should "howard" should be in quotes?
#+HEADER: :dir /etc
#+HEADER: :var USER=howard
#+BEGIN_SRC sh
grep $USER passwd
#+END_SRC
Why do you think that God intended one-based indexing?
Because the He didn't say, "Let there be light!" on the Zeroths Day
A bear sees a rabbit desperatly running through the woods.
The bear says, "what's the hurry?"
The rabbit says, "they're shooting ferrets!"
"But you're not a ferret," says the bear.
"Yeah, OK, and after they shoot you,
good luck explaining you're not a ferret,"
replies the rabbit, and they both start running.
An Englishman, a Frenchman, and a Bavarian were arguing about
what is the hardest language.
"English!" says the Englishman:
"We write 'Leichester' but say 'Lester'"
"No, French!" says the Frenchman:
"We "write 'hors d'ouvres' but say
'Or-derv.'"
"That's nothing," says the Bavarian:
"We write, 'excuse me Sir, could you repeat
youself, I must have misunderstood?' But we say,