Skip to content

Instantly share code, notes, and snippets.

View dvingo's full-sized avatar

Daniel Vingo dvingo

View GitHub Profile
@dvingo
dvingo / memory-test.html
Created April 4, 2015 18:27
create a large number of string objects in js
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>How much memory?</title>
</head>
<body>
<h1>How many JS object can we put in an array?</h1>
<script>
var x = [];
@dvingo
dvingo / id_rsa.pub
Created April 23, 2015 16:46
Public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCpF0uuMDyxXIq8ar1xsJqAWFdCzNOC70D9pgdIXIzEzftK+6PqzZQWo/I2sKIbmjQXAD3u47bfb14vqW//k+UVwKS/0PYmkqUjSCOs+fBVoeuVx95piCk0jMON95Hr9oM/zygLm0cf9jJkxRj30pRi6rs3R0R6ga0WVXCde2U3FYuYp0YxGp6rSpEuiJT0sO0K5VkH36I55hQhINhev7KbKtj1xA05RcFvL/eXNedVkTNvmFD8JrOSKSexmJD7koMtwBExxOpDbOun2r5A0sy1AAkPpxP3HXV15U8VIMbnU5FBBXHgN59F0b2CutDGTR7YHtM3dzPPNfD0DwlDQ9H5 danvingo@gmail.com
@dvingo
dvingo / setup_osx_and_linux_env.sh
Last active April 11, 2020 22:39
Shell script to install software on mac osx.
#!/usr/bin/env bash
os=$(uname -s)
# .bashrc:
# Get the current git branch.
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
@dvingo
dvingo / atom_editor_snippets.coffee
Last active January 7, 2018 16:36
Atom Editor: snippets
#
# How to write atom snippets.
#
# Docs:
# https://atom.io/packages/snippets
#
# Find your source file name key that atom uses:
#
#
# 1. Put your cursor in a file in which you want the snippet to be available.
@dvingo
dvingo / es6-class-react.cljs
Created February 11, 2017 13:22 — forked from pesterhazy/es6-class-react.cljs
React component in pure cljs using ES6 class inheritance
;; implementing a React component in pure cljs, no reagent necessary
;; using goog.object.extend to create a ES6 class that inherits from
;; React.Component
;; credit to @thheller
(defn MyReact [props context updater]
(this-as this
(js/React.Component.call this props context updater)))
@dvingo
dvingo / make_video.sh
Last active July 31, 2018 00:50
Some bash scripts for timelapse and video filters of the raspberry pi camera module.
#!/bin/bash -
# TODO look into auto uploading to youtube:
# https://gist.github.com/joglomedia/569da3d2756257112b53
# See http://photo.stackexchange.com/questions/21089/how-do-i-create-a-timelapse-video-from-a-collection-of-photographs-in-linux
# http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-enc-images.html
dir_of_jpegs=new_timelapse
output_dir=./
@dvingo
dvingo / bezierInWebGL.html
Last active November 12, 2017 18:32 — forked from claus/gist:1396250
Resolution independent rendering of Bezier curves in WebGL
<!doctype html>
<html>
<head>
<title>Resolution independent rendering of Bezier curves in WebGL</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="glMatrix-0.9.6.min.js"></script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec2 aBezierCoord;
@dvingo
dvingo / map-zipper.clj
Last active May 9, 2022 09:45
Clojure zipper for recursively traversing a map
;; inspired by: https://clojuredocs.org/clojure.zip/zipper#example-54d91161e4b081e022073c72
(defn map-zipper
[m ref-keys]
{:pre [(set? ref-keys)]}
(z/zipper
(fn is-branch? [x]
(let [ret
(cond
(not (coll? x))
@dvingo
dvingo / .bash_aliases
Last active May 4, 2023 00:32
.bash_aliases
# Put on the last line of .bashrc:
# [ -f ~/.bash_aliases ] && source ~/.bash_aliases
# In ~/.bash_profile:
# [[ -f ~/.bashrc ]] && . ~/.bashrc
#
os=$(uname -s)
is_linux() {
@dvingo
dvingo / crux-pull.clj
Created April 29, 2020 18:45
limited datomic pull api in crux.
(ns crux-pull
(:require
[edn-query-language.core :as eql]
[crux.api :as crux]
[my-app.crux-node :refer [crux-node]]))
(defn entity
([entity-id] (entity crux-node entity-id))
([crux-node entity-id]
(crux/entity (crux/db crux-node) entity-id)))