Skip to content

Instantly share code, notes, and snippets.

@nicolai86
nicolai86 / ansible-rails example
Created February 12, 2014 06:11
a current usage example for nicolai86.rails-deployment as of v0.6.0
---
- hosts: server
user: app_user
gather_facts: False
vars:
user: app_user
home_directory: "/home/{{ user }}"
deploy_to: "{{ home_directory }}/app"
roles:
@TylerSangster
TylerSangster / Source from fourm
Last active August 29, 2015 13:56
Recurly.JS setup on a rails app
<!DOCTYPE html>
<html class='scrollable'>
<head>
<meta charset="utf-8">
<script type="text/javascript">
//<![CDATA[
window.gon = {};gon.recurly_plan_code="personal";gon.recurly_signature="a1d711146adf5a6148e9750b73838bd0fd984994|nonce=FVPidmDB0CwJuxi3EMsFwZP5T6oIvvq5t7KhHE0q1oc&subscription%5Bplan_code%5D=personal&timestamp=1391699817";gon.recurly_subdomain="teldio";gon.recurly_account_code="1234";gon.recurly_email="[email protected]";gon.recurly_success_url="/";
//]]>
</script>
<title>
@totty90
totty90 / jquery-backbone version
Created January 1, 2014 16:32
React example vs jquery in pure javascript
var BuildTemplate = ' \
<h2 class="small-caps">build</h2> \
';
var BuildV = BaseV.extend({
className: 'btn-group-vertical',
initialize: function(o){
this.__player = o.player;
@wycats
wycats / nfa.rs
Created December 30, 2013 06:03
use std::hashmap::HashSet;
#[deriving(Eq)]
enum CharacterClass {
ValidChars(HashSet<~char>),
InvalidChars(HashSet<~char>)
}
impl CharacterClass {
pub fn valid(string: &str) -> CharacterClass {
@0xabad1dea
0xabad1dea / rsa-not-buying-it.md
Last active May 4, 2022 21:59
Sorry, RSA, I'm just not buying it

Sorry, RSA, I'm just not buying it

I want to be extremely clear about three things. First, this is my personal opinion – insert full standard disclaimer. Second, this is not a condemnation of everyone at RSA, present and past. I assume most of them are pretty okay, and that the problem is confined to a few specific points in the company. However, “unknown problem people making major decisions at RSA” is a bit unwieldy, so I will just say RSA. Third, I'm not calling for a total boycott on RSA. I work almost literally across the street from them and I don’t want to get beat up by roving gangs of cryptographers at the local Chipotle.

RSA's denial published last night is utter codswallop that denies pretty much everything in the world except the actual allegations put forth by Reuters and hinted at for months by [other sources](http://li

@hamzakc
hamzakc / AddsUserToList.rb
Created December 11, 2013 07:44
A different way to write a service object. Made in response to http://re-factor.com/blog/2013/09/27/slow-tests-are-the-symptom-not-the-cause/
class AddsUserToList
attr_reader :notifies_user_klass, :user_klass
def initialize(user_klass = User, notifies_user_klass = NotifiesUser)
@user_klass = user_klass
@notifies_user_klass = notifies_user_klass
end
def add(params)
user_klass.find_by_username!(params.fetch(:username).tap do |user|
notifies_user_klass.(user, params.fetch(:mailing_list_name))
@jboner
jboner / akka-cluster-implementation-notes.md
Last active October 9, 2024 11:34
Akka Cluster Implementation Notes

Akka Cluster Implementation Notes

Slightly disorganized but reasonably complete notes on the algorithms, strategies and optimizations of the Akka Cluster implementation. Could use a lot more links and context etc., but was just written for my own understanding. Might be expanded later.

Links to papers and talks that have inspired the implementation can be found on the 10 last pages of this presentation.

Akka Gossip

Gossip state

This is the Gossip state representation:

@dherman
dherman / realms-api.md
Last active September 7, 2024 17:42
ES6 Realms API

Notational Conventions

This section describes the conventions used here to describe type signatures.

A [T] is an array-like value (only ever used read-only in this API), i.e., one with an integer length and whose indexed properties from 0 to length - 1 are of type T.

A type T? should be read as T | undefined -- that is, an optional value that may be undefined.

Realms

@shanzhong
shanzhong / skimnotes2markdown
Last active August 16, 2016 12:28
My AppleScript for automatically extracting notes from PDF files in Skim and convert to Markdown format (in clipboard) with links (skimmer://) to original PDF file (full path and page number). The converted Markdown format can be pasted into Ulysses III by Edit -> Paste from -> Markdown.
(* Inspired and modified based on http://drosophiliac.com/2012/09/an-academic-notetaking-workflow.html and https://gist.github.com/smargh/6068104 *)
(* PROPERTIES *)
property LF : (ASCII character 10)
property tid : AppleScript's text item delimiters
(* THE SCRIPT *)
tell application "Skim"
set the clipboard to ""
activate
package main
import (
"fmt"
"net/http"
)
func main() {
c := 1
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {