Skip to content

Instantly share code, notes, and snippets.

View SoxFace's full-sized avatar

Sonya SoxFace

View GitHub Profile
@PJUllrich
PJUllrich / big-o.md
Last active April 28, 2024 14:19
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@sunnygleason
sunnygleason / pubnub_gifchat_block.js
Created January 28, 2017 17:41
PubNub GifChat BLOCK w/ Giphy
export default (request) => {
const xhr = require('xhr');
const query = require('codec/query_string');
const apiKey = 'YOUR_API_KEY';
const apiUrl = 'http://api.giphy.com/v1/gifs/search';
const regex = /\/gif\s\(([^.?]*)\)|\/gif\s\w+/g;
let textToAnalyze = request.message.text;
@enjalot
enjalot / README.md
Last active August 30, 2022 22:17
interviewing.io: final comp
@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

Meteor Alternatives Per Feature

This table was created in 2015 so may be quite outdated today.

Feature Meteor Solution Alternative Solutions Description
Live DB Sync [livequery][lq] ([mongo-oplog]), [ddp] RethinkDB, Redis, ShareDB, [npm:mongo-oplog], [firebase], etc. Push DB updates to client/server.
Latency Compensation, Optimistic UI [minimongo][mm] [RethinkDB][lcr], [mWater/minimongo] (fork, not ws but http, browserify) Imitate successful db query on client before it is done.
Isomorphic Code [isobuild] & isopacks browserify Write one code for server/client/mobile.
Isomorphic Packaging [isobuild], atmosphere No more separate packages for server & client. Get bower + npm + mobile.
@jamtur01
jamtur01 / ladder.md
Last active May 17, 2024 07:29
Kickstarter Engineering Ladder
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@amysimmons
amysimmons / wdi_week_9_notes.md
Last active December 26, 2017 06:48
WDI Week 9 Notes
@zaparker
zaparker / array.extend.js
Last active January 27, 2016 04:41
Based on the LINQ extensions for C# IEnumerables, these functions extend the base JavaScript Array object with new methods for chaining together array operations. Also includes some examples and tests.
// performs the specified action on each item in the array
Array.prototype.forEach = function (fnAction) {
var l = this.length;
for (var i = 0; i < l; ++i) {
fnAction(this[i]);
}
}
// returns an array containing the items matching the filter
Array.prototype.where = function (fnFilter) {
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.