Skip to content

Instantly share code, notes, and snippets.

View sideshowcoder's full-sized avatar
💭
🐱

Philipp Fehre sideshowcoder

💭
🐱
View GitHub Profile
@scalabl3
scalabl3 / gist:8046965
Last active September 26, 2019 12:09
Install Elasticsearch 90.5 for Couchbase Integration on Mac via homebrew
These instructions are on Mac OS X, but it can easily be translated for any linux os too. The only differences will be to use default in elasticsearch.yml for vbuckets of 1024 (comment or take that line out). Also the paths to plugins, config, bin, etc. might be different as far as copying the couchbase_template.json over to config/templates.

On Mac I highly recommend just permanently increasing the max number of file descriptors allowed (unlimited is no longer a valid parameter):

$ cd /etc
$ vi launchd.conf
$ limit maxfiles 1000000 1000000
#!/bin/sh
#
# Adam Sharp
# Aug 21, 2013
#
# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`.
#
# Does the inverse of `git submodule add`:
# 1) `deinit` the submodule
# 2) Remove the submodule from the index and working directory
@kesor
kesor / an upstart unicorn.conf
Last active February 9, 2022 09:20
Unicorn that receives USR2 signal on upstart's "stop unicorn", but also allows upstart to respawn it when for some reason it crashed on its own.
# unicorn
description "unicorn ruby app server"
start on (local-filesystems and net-device-up IFACE=lo and runlevel [2345])
stop on runlevel [!2345]
env WORKDIR=/data
env PIDFILE=/data/tmp/pids/unicorn.pid
env CFGFILE=/data/config/unicorn.rb
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

require 'fiddle'
class GVL
handle = Fiddle::Handle::DEFAULT
address = handle['rb_thread_blocking_region']
func = Fiddle::Function.new address, [Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP], Fiddle::TYPE_VOIDP
@simonwelsh
simonwelsh / bot.php
Last active December 17, 2015 05:38
A bot for App.net that monitors its PMs and replies with a link to a "I'm feeling lucky" search for the text.
<?php
/**
* A bot for App.net that monitors its PMs and replies with a link to a
* "I'm feeling lucky" search for the text.
*
* @author Simon Welsh (@simon_w)
* @license WTFPL Version 2 (http://www.wtfpl.net/txt/copying/)
*/
require_once dirname(__FILE__) . '/AppDotNet.php';
@codahale
codahale / SetBenchmark.java
Created April 3, 2013 18:49
An example of how to use Caliper: http://code.google.com/p/caliper/.
import com.google.caliper.Runner;
import com.google.caliper.SimpleBenchmark;
import java.util.HashSet;
import java.util.TreeSet;
public class SetBenchmark extends SimpleBenchmark {
// If you add a main function, you can run it from your IDE.
public static void main(String[] args) throws Exception {
new Runner().run(

So yesterday brought the sad news that Google Reader is being killed off. C’est la vie it seems, given it was a Google product. In my search for an alternative I rediscovered Fever and decided to see if I could run it up for free on Heroku. Onwards...

Personally I think the news about Reeder is quite sad, as I would quite happily have paid for it as a service. In fact I like RSS so much that I actually shelled out the $30 for Fever when it first came out years ago (I was also pretty massive Shaun Inman fanboy if I’m being honest).

I ended up setting Fever aside because screw having to manage self-hosting for PHP and MySQL, right?

If you’re new to Fever I recommend going and checking it out, but also reading the post in response to the Google Reader announcement by Fevers author, Shaun, for a good list of what Fever is and isn’t.

Enough jibba-jabba!