Skip to content

Instantly share code, notes, and snippets.

View r3b's full-sized avatar

ryan bridges r3b

  • Atlanta, Georgia
View GitHub Profile
@sr75
sr75 / wget-jdk-oracle-install-example.txt
Last active March 16, 2023 11:28
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
@BurntSushi
BurntSushi / 01-possible-generic-map.go
Last active May 14, 2019 16:49
Code from my blog post "Writing type parametric functions in Go."
// This is *not* valid Go!
func Map(f func(A) B, xs []A) []B {
ys := make([]B, len(xs))
for i, x := range xs {
ys[i] = f(x)
}
return ys
}
Map(func(x int) int { return x * x }, []int{1, 2, 3})
@justinbmeyer
justinbmeyer / jsmem.md
Last active August 19, 2022 04:50
JS Memory

JavaScript Code

var str = "hi";

Memory allocation:

Address Value Description
...... ...
@penguinboy
penguinboy / Object Flatten
Created January 2, 2011 01:55
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;