Skip to content

Instantly share code, notes, and snippets.

View mose's full-sized avatar

Mose mose

View GitHub Profile
@mose
mose / command.js
Last active August 29, 2015 13:56
A snippet for backtick chrome extension
javascript:window.prompt("Copy to clipboard: Ctrl+C, Enter", document.URL.replace(/sid=[0-9a-f]*&?/,''));return false;

Keybase proof

I hereby claim:

  • I am mose on github.
  • I am mose (https://keybase.io/mose) on keybase.
  • I have a public key whose fingerprint is 3449 95C9 B897 D7F3 053F 64CD 0DEF 40EC 5741 40CA

To claim this, I am signing this object:

@mose
mose / Dokku Intro
Last active August 29, 2015 14:05
dokku presentation using shellplay
?##/ Hello
\e[1;32mHello\e[0m
- I'm mose, SysAdmin at \e[1;34mFaria Systems\e[0m
- \e[1;34mDevops\e[0m duties
= helping developers to deploy their apps
@mose
mose / numeral2number.py
Created March 19, 2013 01:48
Some playing around with python
import re
subnums = [ ('cd',4*'c'),
('xl',4*'x'),
('iv',4*'i'),
('d',5*'c'),
('l',5*'x'),
('v',5*'i'),
('cm',9*'c'),
('xc',9*'x'),
@mose
mose / index.html
Created April 17, 2013 18:46
A CodePen by Mose. Face box-shadows
<div id="face">
<div class="eye left"></div>
<div class="eye right"></div>
<div class="nose"></div>
<div class="mouth"></div>
</div>
@mose
mose / sauce.rb
Created May 10, 2013 09:13
saucelabs rspec trick
if ENV['sauce']
module Job
extend self
def id
@__jobid || 'undefined'
end
def id=(j)
@__jobid ||= j
end
@mose
mose / mail interceptor
Last active December 21, 2015 08:28
mail interceptor in rails
# lib/mailinterceptor.rb
class MailInterceptor
def self.delivering_email(message)
message.to = "dev@example.com"
message.subject = "[#{message.to}] " + message.subject
end
end
# config/initializers/setup_mail.rb
@mose
mose / web.go
Created September 12, 2013 07:52
just a tutorial followup
package main
import (
//"fmt"
"net/http"
"io/ioutil"
"html/template"
"regexp"
"errors"
"log"
require 'json'
file = ARGV[0]
unless file
puts "Usage: ruby #{$0} <json filename of the export>"
exit
end
unless File.exist? file
module.exports = (robot) ->
robot.router.post "/#{robot.name}/capture/:feed", (req, res) ->
filepath = path.join process.env.FILE_BRAIN_PATH, "#{req.params.feed}"
payload = req.body
fs.appendFileSync filepath, "\n---------------------\n#{moment().utc().format()}\n\n"
fs.appendFileSync filepath, JSON.stringify(req.body, null, 2), 'utf-8'
res.setHeader 'content-type', 'text/plain'
res.status(200).end ''