Skip to content

Instantly share code, notes, and snippets.

View diogok's full-sized avatar

Diogo Souza da Silva diogok

View GitHub Profile
@cemerick
cemerick / gist:1485920
Created December 16, 2011 12:46
Working on a CouchDB type for Clojure
;; Clutch provides a pretty comprehensive API, but I'm frustated that 95% of database
;; interactions require using something other than the typical Clojure vocabulary of
;; assoc/conj/dissoc/get/seq/reduce/etc, even though those semantics are entirely appropriate
;; (modulo the whole stateful database thing).
;;
;; This is (the start of) an attempt to create a type to provide most of the
;; functionality of Clutch with a more pleasant, concise API (it uses the Clutch API
;; under the covers, and rare operations would generally remain accessible only
;; at that lower level).
;;
@avelino
avelino / tmux.md
Created October 8, 2012 10:57
tmux cheat sheet

tmux - terminal multiplexer

Managing tmux sessions:

$ tmux      # start tmux server
$ tmux at   # attach running sessions to a terminal
$ tmux ls   # list running tmux sessions

Sharing sessions between terminals:

$ tmux new -s session_name # make new named session

$ tmux at -t session_name # attach to exist session (allowing shared sessions)

@mnapoli
mnapoli / behat-reference.feature
Last active February 12, 2024 10:54
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
@erikhenrique
erikhenrique / bin-cc.md
Last active June 11, 2024 02:03
Bin de cartões de crédito para validação

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3
# let's assume the command is:
# sshcd -v -q root@example.com:/path/to/file
# grabs the last argument of command, the target: "root@example.com:/path/to/file
t="${!#}"
# command to run, which I've broken down line by line
c=(
"ssh"
"-t" # force pseudo-tty allocation (http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1)
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
(defn code-mirror
"Create a code-mirror editor. The parameters:
value-atom (reagent atom)
when this changes, the editor will update to reflect it.
options
:style (reagent style map)
will be applied to the container element
:js-cm-opts
options passed into the CodeMirror constructor
:on-cm-init (fn [cm] -> nil)
@mildsunrise
mildsunrise / README.md
Last active September 13, 2023 09:47
OpenSCAD module for simple gears with round teeth

Simple module that makes gears with circular-shaped teeth. The gears maintain their shape even for extremely low teeth numbers up to 2. Parameters:

  • teeth: number of teeth.
  • step: width of one teeth (diameter of the circle).

Two gears produced with the same step will transfer movement, so one typically fixes a step for all the gears and varies teeth for each gear, which decides the radius and transfer ratio. Example:

@xem
xem / readme.md
Last active May 11, 2024 23:57
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;

@roycewilliams
roycewilliams / liveablecode.md
Last active July 15, 2021 04:53
summary of Sarah Mei's idea or Konmari and liveable code - liveablecode.com