Skip to content

Instantly share code, notes, and snippets.

@theodorosploumis
theodorosploumis / Nework_throttling_profiles.md
Last active November 1, 2024 09:46
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
@akella
akella / facebook-normalize-wheel.js
Created November 25, 2017 22:49
Facebook attempt at normalizing wheel event
/**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule normalizeWheel
* @typechecks
// keeping the same pattern
export default await new Promise(async $export => {
// export the module
$export({my: 'module'});
});
// dropping the Promise all together
export default await (async () => {
// await async dependencies
// export the module

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@joepie91
joepie91 / vpn.md
Last active November 3, 2024 18:40
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@sskylar
sskylar / config.ru
Created February 27, 2015 20:21
Siteleaf config using ENV variables
# Intended for development purposes only, do not upload or use in production.
# See https://github.com/siteleaf/siteleaf-gem for documentation.
require 'rubygems'
require 'siteleaf'
Siteleaf.api_key = ENV['API_KEY']
Siteleaf.api_secret = ENV['API_SECRET']
run Siteleaf::Server.new(:site_id => ENV['SITE_ID'])
@petewarden
petewarden / tumblrproxy.rb
Created October 25, 2012 03:28
An example of proxying a Tumblr blog as a subdirectory in Ruby and Sinatra
get '/blog*' do
path = params[:splat][0]
source_url = 'http://yourblog.tumblr.com' + path.gsub(/ /, '+')
source_content_type = ''
source_body = open(source_url) do |f|
source_content_type = f.content_type # "text/html"
f.read
end
if source_content_type == 'text/html'
output_base = request.base_url + '/blog'
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active October 20, 2024 14:41
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@peter
peter / creating-edgerails-app.sh
Created June 30, 2012 21:03
Creating and Deploying an EdgeRails (Rails 4) Application to Heroku
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it
gem install bundler
# 1. Get edge Rails source (master branch)
git clone https://github.com/rails/rails.git
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods