Skip to content

Instantly share code, notes, and snippets.

View roidrage's full-sized avatar
🌱
Planting seeds

Mathias Meyer roidrage

🌱
Planting seeds
View GitHub Profile
var ip = '199.27.72.162'
var https = require('https')
https.get({
host: ip,
port: 443,
path: '/graceful-fs',
headers: {
host: 'registry.npmjs.org'
}
}, function(res) {

roidrage: Is there a CSS trick that allows me to phase out text that overflows a box? Like a shadow over the last couple of chars. [http://twitter.com/roidrage/status/464692600910651392]

let's say you have this html snippet :

<div>
A text that is too long to fit it's container
</div>
@jewelia
jewelia / gist:595200aae5f9a437a634
Last active August 29, 2015 14:12
Books: 2014 retrospective and to-read for 2015

Many of my friends have shared their reading lists of all the books they read in 2014 (thank you!) -- this gave me some excellent ideas of books to read for 2015.

So I have decided to share my reading list as well, and the list of books I plan to read in 2015. If you have any ideas for additional books, I'd love them (especially in the topic areas of business, finance, nonfiction).

Favorite books I read in 2014:

  • The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers by Ben Horowitz
  • The Everything Store: Jeff Bezos and the Age of Amazon by Brad Stone
  • The Effective Executive: The Definitive Guide to Getting the Right Things Done by Peter F Drucker
  • Zero to One: Notes on Startups, or How to Build the Future by Peter Thiel
%s/\C\<g:NeoComplCache_EnableAtStartup\>/g:neocomplcache_enable_at_startup/ge
%s/\C\<g:NeoComplCache_MaxList\>/g:neocomplcache_max_list/ge
%s/\C\<g:NeoComplCache_MaxKeywordWidth\>/g:neocomplcache_max_keyword_width/ge
%s/\C\<g:NeoComplCache_MaxFilenameWidth\>/g:neocomplcache_max_filename_width/ge
%s/\C\<g:NeoComplCache_KeywordCompletionStartLength\>/g:neocomplcache_auto_completion_start_length/ge
%s/\C\<g:NeoComplCache_ManualCompletionStartLength\>/g:neocomplcache_manual_completion_start_length/ge
%s/\C\<g:NeoComplCache_MinKeywordLength\>/g:neocomplcache_min_keyword_length/ge
%s/\C\<g:NeoComplCache_MinSyntaxLength\>/g:neocomplcache_min_syntax_length/ge
%s/\C\<g:NeoComplCache_IgnoreCase\>/g:neocomplcache_enable_ignore_case/ge
%s/\C\<g:NeoComplCache_SmartCase\>/g:neocomplcache_enable_smart_case/ge
Object.extend(Date.prototype, {
strftime: function(format) {
var day = this.getDay(), month = this.getMonth();
var hours = this.getHours(), minutes = this.getMinutes();
return format.gsub(/\%([aAbBcdDHiImMpSwyY])/, function(part) {
switch(part[1]) {
case 'a': return $w("Sun Mon Tue Wed Thu Fri Sat")[day]; break;
case 'A': return $w("Sunday Monday Tuesday Wednesday Thursday Friday Saturday")[day]; break;
case 'b': return $w("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")[month]; break;
# Our own variable where we deploy this app to
deploy_to = "/srv/example.com"
current_path = "#{deploy_to}/current"
shared_path = "#{deploy_to}/shared"
shared_bundler_gems_path = "#{shared_path}/bundler_gems"
# See http://unicorn.bogomips.org/Sandbox.html
# Helps ensure the correct unicorn_rails is used when upgrading with USR2
Unicorn::HttpServer::START_CTX[0] = "#{shared_bundler_gems_path}/bin/unicorn_rails"
@jdmaturen
jdmaturen / bucket_client.py
Created April 16, 2011 08:31
riak bucket that manages retries + conflict resolution w/ example increment counter implementation
from riak import RiakError
class Bucket(object):
"""Wrap up retries and conflict resolution"""
def __init__(self, client, name, resolve, retries=5):
self.client = client
self.name = name
self.bucket = client.bucket(name) # base bucket
self.resolve = resolve
self.retries = retries
@bernd
bernd / gossip.rb
Created May 9, 2011 13:16
Playing with a gossip protocol based on EventMachine
require 'rubygems'
require 'eventmachine'
# Playing around with a gossip protocol idea.
class NodeList
attr_reader :owner, :count
def initialize(owner)
@owner = owner
@jdmaturen
jdmaturen / pbc_pool_transport.py
Created June 20, 2011 23:39
Riak python client PBC connection pooling
import logging
log = logging.getLogger('socrates')
from Queue import Empty, Full, Queue
from riak.transports import RiakPbcTransport
from riak.transports.transport import RiakTransport
class PbcPoolTransport(RiakTransport):
@kellymclaughlin
kellymclaughlin / luwak_file_iterate.erl
Created November 29, 2011 16:50
Luwak inspection
Fun = fun(C, File) ->
{ok, TLObj} = C:get(<<"luwak_tld">>, File, 2),
{_, TLVal} = hd(riak_object:get_contents(TLObj)),
FileRoot = proplists:get_value(root, TLVal),
{ok, RootObj} = C:get(<<"luwak_node">>, FileRoot),
{_, RootVal} = hd(riak_object:get_contents(RootObj)),
{_, _, ChunkKeys} = RootVal,
[begin
case C:get(<<"luwak_node">>, K) of
{ok, _} ->