Skip to content

Instantly share code, notes, and snippets.

View qwo's full-sized avatar

Stanley Zheng qwo

View GitHub Profile
@kyledrake
kyledrake / ferengi-plan.txt
Last active January 10, 2025 14:02
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@staltz
staltz / introrx.md
Last active May 15, 2025 10:37
The introduction to Reactive Programming you've been missing
@qwo
qwo / meetup.js
Last active August 29, 2015 14:03
Meetup Raffle Script
//pass in number of winners
//todo UNIQUE winners and prize mapping
var pickWinners = function(numberOfWinners){
var meetup = $(".member-name");
var winners = [];
var picked_numbers = {};
while (numberOfWinners){
var winner = Math.floor(Math.random() * meetup.length);
////bug in duplciates ins winners array
@rygorous
rygorous / vr_urgh.txt
Last active September 6, 2022 21:35
What I mean when I say "I think VR is bad news".
This just got linked to by the Y combinator news account, without proper context,
so a brief introduction: A month ago (end of May / early June 2014) I had a
Twitter conversation with a bunch of acquaintances. One tweet in the middle
of that thread, with obligatory hyperbole, was me saying that I think VR is
bad news.
Well, that part of the thread (but not the rest that provides context) recently
got retweeted, and then someone asked me if I could explain what I mean by that,
and because Twitter is a great platform for delivering 140 character slogans and
not so great for lengthy explanations, I wrote this. So, obligatory disclaimer:
@simoncollins
simoncollins / README.md
Last active August 29, 2015 14:04
Sending messages to Tessel

This shows how to send messages to a connected Tessel over USB and how to log messages that the Tessel writes to console.log().

You'll need to do a tessel push tessel-code.js to push the script to the Tessel first as it seems you can only have one connection at a time (unless there's another way I'm not aware of).

Then run node host-code.js to send the message to Tessel. You should see Tessel log back the message it received.

@lucasdavila
lucasdavila / fixup.txt
Last active December 20, 2023 12:00
Fixing mac os yosemite issue "bash: fork: Resource temporarily unavailable"
# see the current limits
$ sysctl -a | grep maxproc
# increase it
$ sudo sysctl -w kern.maxproc=xxxx
$ sudo sysctl -w kern.maxprocperuid=xxx
# run at startup
$ sudo vim /etc/sysctl.conf
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@qwo
qwo / setup_osx.sh
Last active September 21, 2017 00:49 — forked from zenorocha/.hyper.js
setup your macbook very fast using homebrew, tools of the internet and scripts. all is borrowed
#!/bin/sh
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# homebrew-cask
brew tap phinze/homebrew-cask
brew install brew-cask
# development
@cowboy
cowboy / currying-use-case.js
Created January 29, 2015 16:17
JavaScript: I've finally found a use case for currying in JavaScript!
// You can have multiple optional arguments, but only if the arguments
// can be distinguished from one another (in this example, by type)
function optionalUnambiguous(myString, myNumber) {
if (typeof myString === 'number') {
myNumber = myString;
myString = null;
}
if (myString == null) { myString = 'default'; }
if (myNumber == null) { myNumber = 0; }
@metaskills
metaskills / challenge.rb
Last active August 29, 2015 14:16
Ruby Solution To Phrase Synonym Count Winner
# 1) Write a function which takes a phrase.
# 2) Phrase is "May the force be with you"
# 3) Which of these words has the most synonyms
require 'json'
require 'net/http'
API_KEY = 'SECRET'
BASE_URL = "http://thesaurus.altervista.org/service.php?language=en_US&output=json&key=#{API_KEY}&word=";