Skip to content

Instantly share code, notes, and snippets.

View purp's full-sized avatar
🖤
https://xrl.us/mlkbirmletterpdf

Jim Meyer purp

🖤
https://xrl.us/mlkbirmletterpdf
View GitHub Profile
@smithclay
smithclay / aws.tf
Created July 19, 2017 19:57
Multi-Cloud New Relic Blog Post: Terraform Configuration of AWS, Azure and GCP Load Balancers with Instance Groups (Autoscaling enabled)
variable "aws_region" {
description = "EC2 Region for the VPC"
default = "us-west-2"
}
variable "aws_availability_zones" {
default = "us-west-2a,us-west-2b,us-west-2c"
description = "List of availability zones, use AWS CLI to find your "
}
// API End-Point
http://www.one-tab.com/api/createPage

// POST Payload
{
  "key": "483e6ba2-08d6-4cb4-b167-550856f4d7c0",
  "tabGroups": [{
    "id": "aek6X7rnpxWCtUjcfcKTtw",
 "tabsMeta": [{
@jmvrbanac
jmvrbanac / install_pyenv.sh
Last active February 16, 2023 09:29
Install pyenv on Ubuntu
#!/bin/bash
sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl
sudo pip install virtualenvwrapper
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
@ctalkington
ctalkington / Gemfile
Last active May 16, 2023 20:19
Nginx, Sinatra, and Puma.
source :rubygems
gem "puma"
gem "sinatra"
@mhagerty
mhagerty / yahooOauth
Created December 5, 2012 19:39
A sample Ruby script utilizing Mechanize to navigate Oauth authentication for Yahoo Sports API
# Author: Mike Hagerty, 11/28/2012
# The purpose of this script is to pull data from the Yahoo Sports API. I tried to document the steps as thoroughly as possible, as I had a
# tough time navigating this process
# Yahoo Sports requires Oauth authentication for personal team-related data. This requirement complicates the automation of pulling data, as Oauth in general requires user interaction to complete the authentication process.
# Mechanize is used to automate the user interaction steps required to authenticated via Oauth.
# This script also has example code for storing the data in a mongodb at the end
#!/usr/bin/ruby
@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

@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
require 'rubygems'
require 'nokogiri'
class MyFilter
def ends_with set, ends
set.map { |x| x.to_s }.join.end_with? ends
end
end
doc = Nokogiri.XML(DATA)