Skip to content

Instantly share code, notes, and snippets.

// jsonnet -S -V depth=5 hanoi.jsonnet >/tmp/hanoi.html && open /tmp/hanoi.html
local depth = std.parseInt(std.extVar('depth'));
local rect(width, height, column) = [
'rect',
{
width: width * 40,
height: 40,
x: (column + 1) * 300 - width * 20,
@ericfode
ericfode / index.html
Created May 6, 2020 03:56
JS Audio Visualizer
<div id="content">
<input type="file" id="thefile" accept="audio/*" />
<canvas id="canvas"></canvas>
<audio id="audio" controls></audio>
</div>
@ericfode
ericfode / pytorch-on-circleci.yml
Created October 21, 2019 16:45
yaml snippet for building pytorch.
build-pytorch:
machine:
image: windows-server-2019-nvidia:edge
steps:
- run:
name: Download cudnn
command: |
$output = "cudnn.zip"
$url = "https://storage.googleapis.com/circleci-image-file/cudnn-10.1-windows10-x64-v7.6.4.38.zip" #
(New-Object System.Net.WebClient).DownloadFile($url, $output)
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sha256 'c3f78752a68a0c3f62efb3332cceea0c8a1f04f7cf6b46e00ec0c3000bc8483e'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'Solarized'
Plugin 'SuperTab'
{"meta":{"code":200},"data":[{"id":235681245,"credit_id":351968,"address_id":71838242,"delivery_date":null,"user_id":9283,"charge_id":"ch_6hP6yk4XenlVrE","created_at":"2015-07-29T19:32:55.237Z","updated_at":"2015-07-29T21:01:26.217Z","total":"46.34","shipping_price":"0.0","receipt_sent_at":"2015-07-29T20:54:13.494Z","refund_amount":"0.0","refund_processed_at":null,"special_instructions":"ring doorbell number 1 with no name","subtotal":"40.3","coupon_discount":{"fractional":"0.0","currency":{"id":"usd","alternate_symbols":["US$"],"decimal_mark":".","disambiguate_symbol":null,"html_entity":"$","iso_code":"USD","iso_numeric":"840","name":"United States Dollar","priority":1,"smallest_denomination":1,"subunit":"Cent","subunit_to_unit":100,"symbol":"$","symbol_first":true,"thousands_separator":","},"bank":{"rounding_method":null,"rates":{},"mutex":{}}},"charge_amount":"46.34","canceled_at":null,"canceled_sent_at":null,"route_order":null,"refund_reason":null,"refund_special_message":null,"duplicate_of_id":null,"admi
@ericfode
ericfode / .spacemacs
Last active August 29, 2015 14:21
My spacemacs dot file
;; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
@ericfode
ericfode / chef-standards
Last active August 29, 2015 14:08
Hello!
Prior art
===========
Cookbook style guides
---------------------
* https://github.com/ampledata/cookbook-style-guide
* https://github.com/infochimps-labs/ironfan/wiki/style_guide
* https://github.com/secondmarket/chef-style-guide
* http://acrmp.github.io/foodcritic/
require 'serverspec'
include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS
describe 'resolve assigned host name to an ipaddress' do
describe host('test-node') do
it { should be_resolvable.by('hosts') }
end
end
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
#Hygene
guard "foodcritic", :cookbook_paths => ".", :all_on_start => false do
watch(%r{attributes/.+\.rb$})
watch(%r{providers/.+\.rb$})
watch(%r{recipes/.+\.rb$})
watch(%r{resources/.+\.rb$})
watch(%r{^templates/(.+)})