Skip to content

Instantly share code, notes, and snippets.

View ecarter's full-sized avatar

E. T. Carter ecarter

View GitHub Profile
@ylegall
ylegall / attractors.py
Created February 19, 2021 00:24
code for animating strange attractors in blender
import bpy
import bmesh
import random
from mathutils import Vector, noise, Matrix
from math import sin, cos, tau, pi, radians
from utils.interpolation import *
from easing_functions import *
frame_start = 1
total_frames = 120
@basimhennawi
basimhennawi / graphicsmagick.txt
Last active May 24, 2022 19:20
Graphicsmagick and Imagemagick static binaries for AWS Lambda
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime
# As of Dec 6, 2018, this is Amazon Linux AMI – amzn-ami-hvm-2017.03.1.20170812-x86_64-gp2
# Check latest from here: https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html
# SSH to Amazon Linux AMI instance, that you just created:
ssh -i ${EC2_KEY} ${EC2_USERNAME}@${EC2_IP}
sudo yum -y install libpng-devel libjpeg-devel libtiff-devel gcc
# GraphicsMagick download latest stable as of Dec 6, 2018, this is 1.3.31 (latest stable)
curl -O https://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/1.3.31/GraphicsMagick-1.3.31.tar.gz
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@timpaul
timpaul / date-of-birth.html
Created August 15, 2012 14:49
HTML markup for a date-of-birth picker
<div class="control-group">
<label for="dob-day" class="control-label">Date of birth</label>
<div class="controls">
<select name="dob-day" id="dob-day">
<option value="">Day</option>
<option value="">---</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
border()
if 1 == length(arguments)
border: 1px solid arguments
else
border: arguments
@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@kmiyashiro
kmiyashiro / admin.html
Created May 10, 2012 21:02
Mocha HTML spec
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../libs/mocha.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div id="mocha"></div>
<script src="../libs/mocha.js" type="text/javascript" charset="utf-8"></script>
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@davglass
davglass / gist:1830797
Created February 14, 2012 21:49
Greps for console.log|info|warn|error in source files.
#!/bin/bash
# Save this file somewhere in your path as git-console
# Then cd into a directory and execute git `console`
# This works well for yui3/src/module directories since it only checks ./js/*
#Scans the ./js/* dir or * for console.log, console.info, console.warn or console.error
# It will still pass if it finds //console.log, but it will not
# catch console.log statements inside a block comment: /* console.log */
@cperl82
cperl82 / gist:1742684
Created February 5, 2012 04:22
Custom statusline for NERDTree with Powerline
diff --git a/autoload/Powerline/Matches.vim b/autoload/Powerline/Matches.vim
index 2244f57..98d9cde 100644
--- a/autoload/Powerline/Matches.vim
+++ b/autoload/Powerline/Matches.vim
@@ -2,6 +2,7 @@ let g:Powerline#Matches#matches = {
\ 'command_t' : Pl#Match#Add('bufname("%")', 'GoToFile'),
\ 'ft_help' : Pl#Match#Add('&ft' , 'help'),
\ 'ft_man' : Pl#Match#Add('&ft' , 'man'),
+ \ 'ft_nerdtree' : Pl#Match#Add('&ft' , 'nerdtree'),
\ 'ft_qf' : Pl#Match#Add('&ft' , 'qf'),