Skip to content

Instantly share code, notes, and snippets.

View marcusmoore's full-sized avatar

Marcus Moore marcusmoore

View GitHub Profile
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@mogsdad
mogsdad / GCalUtils.md
Last active May 10, 2021 17:39
Collection of Google Calendar related utility functions for Google Apps Script.

Google Calendar Utilities

getEventsWithGuest

Gets all events that occur within a given time range, and that include the specified guest email in the guest list.

###Parameters:###

@paulund
paulund / add-option-to-dropdown.js
Created June 25, 2013 18:50
Add and Remove Options in Select using jQuery
$("#selectBox").append('<option value="option6">option6</option>');
@ijmacdowell
ijmacdowell / adjectives.js
Last active May 5, 2024 18:53
javascript string array of nouns, adjectives, and verbs.
var adjectives = ["aback","abaft","abandoned","abashed","aberrant","abhorrent","abiding","abject","ablaze","able","abnormal","aboard","aboriginal","abortive","abounding","abrasive","abrupt","absent","absorbed","absorbing","abstracted","absurd","abundant","abusive","acceptable","accessible","accidental","accurate","acid","acidic","acoustic","acrid","actually","ad","hoc","adamant","adaptable","addicted","adhesive","adjoining","adorable","adventurous","afraid","aggressive","agonizing","agreeable","ahead","ajar","alcoholic","alert","alike","alive","alleged","alluring","aloof","amazing","ambiguous","ambitious","amuck","amused","amusing","ancient","angry","animated","annoyed","annoying","anxious","apathetic","aquatic","aromatic","arrogant","ashamed","aspiring","assorted","astonishing","attractive","auspicious","automatic","available","average","awake","aware","awesome","awful","axiomatic","bad","barbarous","bashful","bawdy","beautiful","befitting","belligerent","beneficial","bent","berserk","best","better","bewilde
@jeremeamia
jeremeamia / Twilio_Client.php
Last active May 15, 2018 21:45
The beginnings of a Guzzle-based, PHP Twilio client.
<?php
namespace Twilio;
use GuzzleHttp\Client as HttpClient;
use GuzzleHttp\Collection;
use GuzzleHttp\Command\Guzzle\GuzzleClient;
use GuzzleHttp\Command\Guzzle\Description;
use GuzzleHttp\Command\Model;
use GuzzleHttp\Subscriber\Retry\RetrySubscriber;

Discussion: Getting started with client-side applications.

Note: While my stack consists of Laravel (4/5) and AngularJS, i don't want this discussion to become a language or framework flame war, let's keep it respectable.

I would love the result of this to become an incredibly helpful blog post & guide.

Hi guys, i'm currently in the throes of (among other things), writing a client-side application to interact with an API (that i control). And there's a few things that confuse me, and i'd love to start an open discussion on the best patterns to use when building client side applications in order to achieve some of the following:

Securely authenticating users.

@adamwathan
adamwathan / v-cloak.md
Last active February 26, 2023 14:26
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@iolson
iolson / .env.example
Created September 17, 2015 22:14
GitLab CI Laravel 5.1.*
DB_HOST=mysql
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
@ehvanr
ehvanr / ban_dupes.py
Last active May 2, 2018 14:17
Duplicate User Plex IPTables Drop Rule
#!/usr/bin/env python
# DESCRIPTION:
#
# This script is meant to be run as a root cronjob. You can run it however frequently
# you desire - I run it every minute. It determines the number of streams, and cross
# references the usernames. If there are duplicate usernames, it checks if the IP
# addresses are different. If so, it generates IPTables rules that will drop packets
# from both IP addresses.
#
@ericvanjohnson
ericvanjohnson / ThrottleRequest.php
Last active July 18, 2016 07:37
My back port to Laravel 5.1 of the Laravel 5.2 middleware feature to have the ability to throttle request coming in.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
use Illuminate\Cache\RateLimiter;
class ThrottleRequests
{