Skip to content

Instantly share code, notes, and snippets.

View ccamel's full-sized avatar
🐫
Mind blowing

Chris ccamel

🐫
Mind blowing
View GitHub Profile
@ricardogarfe
ricardogarfe / cc-latex-title-page-snippet.tex
Last active November 20, 2021 18:06
creative-commons in LaTeX document title page
\documentclass[11pt]{scrartcl}
% Image package
\usepackage{graphics}
% Href package for urls
\usepackage{hyperref}
% You need to place images in local directory
\graphicspath{{images/}}
\title{\textbf{Creative commmons license}}
@enaeseth
enaeseth / objectid_to_uuid.py
Created June 12, 2013 19:29
Convert a MongoDB ObjectID to a valid, semantically similar UUID.
"""
Convert a MongoDB ObjectID to a version-1 UUID.
Python 2.7+ required for datetime.timedelta.total_seconds().
ObjectID:
- UNIX timestamp (32 bits)
- Machine identifier (24 bits)
- Process ID (16 bits)
- Counter (24 bits)
@hadley
hadley / r-is-like.md
Last active December 13, 2021 22:41
A lighthearted and overly flattering comparison of R to other programming languages: what other comparisons have I missed?

R is like:

  • Clojure, because most objects are immutable
  • Scala, because it combined functional and OO techniques
  • Node.js, because the interpreter is single threaded
  • PHP, because it favours pragmatism over purity
  • Lisp, because it's homoiconic
  • Perl, because OO is (mostly) implemented using the language itself
@timyates
timyates / Currying.java
Last active March 7, 2020 07:11
Currying and composition in Java 8
package java8tests ;
import java.util.function.BiFunction ;
import java.util.function.Function ;
public class Currying {
public void currying() {
// Create a function that adds 2 integers
BiFunction<Integer,Integer,Integer> adder = ( a, b ) -> a + b ;
@drobakowski
drobakowski / .editorconfig
Last active March 3, 2020 12:46
EditorConfig file for Erlang. See http://EditorConfig.org
# EditorConfig file: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
@mdwhatcott
mdwhatcott / Iterative_example_test.go
Created February 28, 2014 05:20
Example of using table-driven testing with GoConvey (also shows how to use `Reset`)
package regexps
import (
"fmt"
"regexp"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
@sathomas
sathomas / README.md
Last active July 13, 2018 07:43
Understanding D3.js Force Layout - 5: charge

This is part of a series of examples that describe the basic operation of the D3.js force layout. Eventually they may end up in a blog post that wraps everything together. If you missed the beginning of the series, here's a link to first example.

The previous example shows how linkDistance tells the force layout the desired distance between connected nodes. It may seem strange that D3 doesn't simply compel all links to be that distance. The force layout, however, takes

@AmauryCarrade
AmauryCarrade / Science.md
Last active October 30, 2021 14:52
La science sur YouTube

Chaînes scientifiques et informatives YouTubiennes

(Aucun ordre particulier.)

Français

  • Mickaël Launay : diverses vidéos autour des mathématiques. Cours de maths, jeux de logique, chroniques ou encore manipulations autour des mathématiques.
  • Experimentboy : « Des expériences et des découvertes, des plus folles aux plus intrigantes avec une petite touche... experimentboy :D »
  • e-penser : « Il y a un paquet de choses qui sont parfaitement acquises et sur lesquelles on ne revient jamais. Pourtant, si on prend le temps d'y penser, les choses ne sont pas nécessairement aussi évidentes qu'elles le semblent. Sur e-penser, nous allons tenter de creuser un peu, qu'il s'agisse de science, d'histoire, de culture générale, voire parfois simplement de bon sens. »
@yosssi
yosssi / go-nginx.md
Last active April 11, 2024 22:07
Go networking performance vs Nginx

1. Nginx

$ wrk -t12 -c400 -d2s http://127.0.0.1:8080
Running 2s test @ http://127.0.0.1:8080
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.71ms    3.16ms  23.05ms   69.17%
    Req/Sec     3.44k     1.98k    7.80k    58.22%
  63697 requests in 2.00s, 17.86MB read
@Restuta
Restuta / framework-sizes.md
Last active March 7, 2024 00:01
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js