Skip to content

Instantly share code, notes, and snippets.

/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license
@levinotik
levinotik / p1.scala
Created August 22, 2014 14:11
package naming
package com.foo.bar.users
import scala.concurrent.ExecutionContext.Implicits.global
var i = 1
scala.concurrent.Future{i = 2} //something "happens"
(?:^|(?:[.!?]\s))(\w+):(?:|(?:[.!?]\s))(\w+):

I dont' really have strong opinions (at the moment) regarding which config management system is best. For now, I'm managing a relatively simple topology/infrastructure or whatever the hell you want to call it.

We're running everything on AWS. We have multiple services, each of which is just a jar file run as a service on an EC2 instance. We have prod and stage environments, wherein the same services run but backed by different dependencies, i.e. stage services point to a stage RDS and redis instance, etc. So, for the most part, deploying changes to production means simply getting the new artifact (jar) onto a box somewhere. This is simple, I know. I'm just trying to figure out a solution that makes sense.

Here's the approaches I've tried so far:

packer + terraform - bake a new AMI, supply the id to terraform and replace existing instances with new ones.

ansible - use provisioning callbacks to have newly launched instances "phone home" and get provisioned by ansible. Existing instances can be updated by

Hey there,
As a relatively new Haskell user, I've been pretty disappointed with the state of haskell.org. I know I'm preaching to the choir here, but with large portions of the site currently inaccessible and others taking an unreasonable amount of time to load (at least up until recently), haskell.org is far from usable. Members of #haskell-infrastructure were kind enough to answer some of my questions yesterday when I was trying to get the lay of the land and understand how things work and what the current process it. I know that there's currently a loose confederation of volunteers working on haskell.org as with any open-source project and I wanted to see how I might be able to help.
I have experience with devops -- not a ton, but enough. It may very well be that there's nothing I can help with and that everyone is already familiar with the issues and working on them. However, if part of the issue is time then I'm here to offer some. I seem to be hearing people in #haskell-infrastructure say that they'r

Hey there,

As a relatively new Haskell user, I've been pretty disappointed with the state of haskell.org. I know I'm preaching to the choir here, but with large portions of the site currently inaccessible and others taking an unreasonable amount of time to load (at least up until recently), haskell.org is far from usable. Members of #haskell-infrastructure were kind enough to answer some of my questions yesterday when I was trying to get the lay of the land and understand how things work and what the current process it. I know that there's currently a loose confederation of volunteers working on haskell.org as with any open-source project and I wanted to see how I might be able to help.

I have experience with devops -- not a ton, but enough. It may very well be that there's nothing I can help with and that everyone is already familiar with the issues and working on them. However, if part of the issue is lack of time then I'm here to offer some. I seem to be hearing people in #haskell-infrastructure say tha

module TransformersPart1 where
import Control.Monad.Trans.Maybe
import Data.Functor
import Text.Read (readMaybe)
-- plain old Maybe example (avoiding division by zero)
ex1 :: Int -> Int -> Maybe Int
ex1 x y | y > 0 = Just (x `div` y)
| otherwise = Nothing
@levinotik
levinotik / dedupify.rb
Created October 11, 2011 00:29
A Ruby script I wrote to search directories recursively for all JPEGs and delete duplicates
#!/usr/bin/env ruby
require 'digest/md5'
# Pass the directory path in which to
# recursively search for duplicate JPEG files as the ARG. The uniqueness of each JPEG
# is determined by its hexidigest. Duplicates are added to an array and
# then deleted.
ARGV.each do |path|
unique_photos = Hash.new
require 'spec_helper'
describe PagesController do
render_views
describe "GET 'home'" do
it "should be successful" do
get 'home'
response.should be_success
end