Skip to content

Instantly share code, notes, and snippets.

import { Post } from './database';
import express from 'express';
import bodyParser from 'body-parser';
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.get('/posts', function(req, res) {
<!doctype html>
<html>
<head>
<title>Merus.me</title>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"></link>
<link rel="stylesheet" href="style.css"></link>
</head>
<body>
<div class="jumbotron">
<nav class="navbar navbar-static-top">
@dgb
dgb / .profile
Created September 13, 2014 20:52
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
export CLICOLOR=1
xcode_path="$(xcode-select -p)"
source "$xcode_path/usr/share/git-core/git-completion.bash"
source "$xcode_path/usr/share/git-core/git-prompt.sh"
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWCOLORHINTS=true
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
ARGF.each do |n|
name = n.chomp
begin
open "https://api.angel.co/1/search/slugs?query=#{name}"
puts "#{name},1"
rescue OpenURI::HTTPError => e
@dgb
dgb / keybase.md
Last active August 29, 2015 14:00

Keybase proof

I hereby claim:

  • I am dgb on github.
  • I am dgb (https://keybase.io/dgb) on keybase.
  • I have a public key whose fingerprint is 8024 EABA 84E2 A134 D248 C244 EBCD 79C9 9CB2 7C9F

To claim this, I am signing this object:

> cd foo && \
> mkdir app/assets/pages && \
> echo '<%= stylesheet_link_tag "application" %>' > app/assets/pages/foo.html.erb && \
> rake assets:precompile --trace
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
@dgb
dgb / application.rb
Created November 21, 2011 18:35
Single file Rails application
require "action_controller/railtie"
class Application < Rails::Application
config.session_store :cookie_store, :key => '_rails_session'
config.secret_token = '095f674153982a9ce59914b561f4522a'
end
class PagesController < ActionController::Base
def index
render :text => "Hello, world!"
@dgb
dgb / gist:1344196
Created November 7, 2011 04:41
Bootstrap 1.4 with Devise styles
/*!
* Bootstrap @VERSION
*
* Copyright 2011 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Date: @DATE
*/
@dgb
dgb / devise.coffee
Created September 13, 2011 06:34
Twitter Bootstrap styles for Devise
$ ->
$('.close').live 'click', (e) ->
e.preventDefault()
$(this).parent().hide()
$('.devise form div i').each ->
$this = $(this)
text = $this.text()
sibling = $this.prev('label')
a = $("<a>").text("*").attr('title', text)
a.prependTo(sibling)
@dgb
dgb / spinner.js
Created March 1, 2011 04:38
Refactored Canvas AJAX Spinner
/*
Ajax spinning indicator. The constructor accepts two arguments:
element - the canvas element of the spinner
options - an object of options that are initialized with the instance
- check out the code to see what options you have :P
This thing is more or less refactored from Adam's work:
http://starkravingcoder.blogspot.com/2007/09/canvas-loading-indicator.html
No license was specified by Adam, so as a sort-of derivitive work,