Skip to content

Instantly share code, notes, and snippets.

@konklone
konklone / ssl.rules
Last active August 8, 2023 08:39
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@samullen
samullen / productivity.sh
Last active January 30, 2019 18:46
The two most productivity increasing Bash functions ever written.
function worktime {
echo "# WORKTIME" | sudo tee -a /etc/hosts > /dev/null
while read -r line; do
echo "127.0.0.1 ${line}"
done < $HOME/.blocked_sites | sudo tee -a /etc/hosts > /dev/null
}
function slacktime {
flag=0
while read -r line; do
@mislav
mislav / gist:5897126
Last active September 27, 2021 09:34
Low-value pull requests are worse than useless

Why do I feel insulted Re: automated bots making pull requests

An open source project is a lot of work. There are features to be built, bugs to be solved, releases to be made, documentation to be written and the inevitable support you have to provide via GitHub issues, Twitter and mailing lists.

Like anything worth doing, throughout this process there are hard problems that need to be solved. Valued contributors are ones who study the project's philosophy, understand the subject matter and are thinkers who gift their experience and time to the cause.

Therefore a person or a bot who joins in with a pull request that was a result of running a tool against the project's source code—like code linting or stripping of unnecessary whitespace—is a lowest form of contribution there is. It makes the statement: “Here, I didn't bother to see what current problems are in need of discussing/solving, so I ran a widely available script from the command-line t

@seifsallam
seifsallam / Moving from ember-rails to Yeoman.md
Last active December 18, 2015 14:39
If you were using ember-rails and want to move it out to its own app. Here are the steps using Yeoman

Using Yo Ember instead of Ember-Rails

First Generate Ember application using Yo Ember generator

  1. Install yeoman npm install -g yo grunt-cli bower
  2. Install ember-generator npm install -g generator-ember
  3. Create your project mkdir webapp && cd webapp
  4. Generate ember template yo ember
  5. Run itgrunt server
@machty
machty / router-facelift-guide.md
Last active November 11, 2023 06:44
Guide to the Router Facelift

Ember Router Async Facelift

The Ember router is getting number of enhancements that will greatly enhance its power, reliability, predictability, and ability to handle asynchronous loading logic (so many abilities), particularly when used in conjunction with promises, though the API is friendly enough that a deep understanding of promises is not required for the simpler use cases.

@mariovisic
mariovisic / factory_girl.rb
Created March 22, 2013 04:56
Do not allow Factory Girl usage in unit tests.
# spec/support/factory_girl.rb
# This file is here to limit the use of factories to only integration tests and not unit tests.
#
# If you really want to use a factory you can add the tag :factories to a test
#
module FactoryGirlBlocker
mattr_accessor :disabled
def self.with_disabled
self.disabled = true
@machty
machty / explanation.md
Last active December 15, 2015 00:09
explanation of new transition redirect/prevention on http://emblem-test.herokuapp.com/

Check out the progress on redirectable/preventable transitions.

This consists almost entirely of a rewrite of router.js, with hardly any changes to the Ember codebase. Lots of things have been added router-wise, but this particular demo focuses on how attempted transitions can be intercepted/redirected/prevented/decorated by defining transition event handlers in a transitions hash on Ember.Route. I also added support for URL-less routes (see the URL-less States Demo at the top in the link below). You can test this out yourself with this branch of Ember, which has the new router.js code i've been working on in it.

I ended up reusing the Emblem test app, so try not to be distracted by the template syntax stuff (sorry, twas most readily available for trying this new transition code). You can check out the code for this transition demo here. Below I've highlighted the m

@jbgo
jbgo / debug_system_stack_error.md
Created January 9, 2013 15:08
debug SystemStackError in ruby 1.9

This is how I debug SystemStackError when there is no stack trace.

My first attempt was:

begin
  a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
  puts caller
end
@eerohele
eerohele / install-ruby-1.8.5-ubuntu-rbenv.md
Created January 4, 2013 12:11
Installing Ruby 1.8.5 on Ubuntu with rbenv
  1. Install rbenv.

  2. Download and compile OpenSSL 0.9.8x:

     $ tar zxvf openssl-0.9.8x.tar.gz
     $ cd openssl-0.9.8x
     $ ./config
     $ make
     $ make test
     $ make install
    
@uu59
uu59 / .gitignore
Created August 13, 2012 08:12
socket.io and Sinatra
vendor/
.bundle/
node_modules/
Gemfile.lock