Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

David Petrie cdave1

I may be slow to respond.
Block or report user

Report or block cdave1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CSharpAllocTest.cs
using System;
public class StringAllocTest {
public static void Main(string[] args) {
Random random = new Random();
var variable_here_so_runtime_allocation_needed = random.Next(0, 1000000);
Log("HERE IS A VERY LONG STRING, AND IT MIGHT " + variable_here_so_runtime_allocation_needed + " BE SO LONG THAT HEAP MEMORY MUST BE ALLOCATED TO STORE IT OMG!"); //, false);
cdave1 / gist:1b781d444bf45338be104f8fe5887db3
Created Jan 15, 2018 — forked from carlos8f/gist:b09a734cf626ffb9bb3bcb1ca35f3db4
zenbot sim result, BTC-USD, 90 days, 195.45% profit, 61.06% over buy/hold
View gist:1b781d444bf45338be104f8fe5887db3
2017-05-11 16:00:00 1832.97 USD -0.06% 619.75 + 0.0447 null 1.91% 0.031060 BTC 2897.41 USD 195.43% +61.48%
{ days: 90,
profit_stop_enable_pct: 10,
profit_stop_pct: 1,
sell_rate: -0.006,
trend_ema: 36,
period: '1h',
strategy: 'trend_ema_rate',
sell_stop_pct: 4,
buy_stop_pct: 0,
View paper-degrees-example.js
'use strict';
var paper = require('paper');
paper.setup(new paper.Size(2048, 1440));
function ShapeIntersection() {
var diamond0 = new paper.Path.RegularPolygon(new paper.Point(0, 0), 4, 100);
View .config
View gist:c635ffa3012961e0a372
ext2load mmc 0 0x48000000 uImage
ext2load mmc 0 0x43000000 sun7i-a20-bananapi.dtb
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait panic=10 ${extra}
bootm 0x48000000
View uEnv.txt
bootargs=console=ttyS0,115200 console=tty0 disp.screen0_output_mode=EDID:1280x720p50 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
aload_script=fatload mmc 0 0x43000000 script.bin;
aload_kernel=fatload mmc 0 0x48000000 uImage; bootm 0x48000000;
uenvcmd=run aload_script aload_kernel
cdave1 /
Created Sep 27, 2014
Shell script for creating banana pi image with kernel 3.4.90
rm -rf build
mkdir -p build
echo "[INFO] Creating u-boot for bananapi"
if [ ! -d u-boot-bananapi ]; then
git clone
elif [ -d u-boot-bananapi ]; then
( cd u-boot-bananapi && git pull )
cdave1 /
Last active Aug 29, 2015
Experimental shell for creating an image with 3.12.28 of the kernel (image did not boot for me). REQUIRES kernel 3.12.28 from
rm -rf build
mkdir -p build/boot
echo "[INFO] Creating u-boot-bananapi"
if [ ! -d u-boot-bananapi ]; then
git clone
elif [ -d u-boot-bananapi ]; then
( cd u-boot-bananapi && git pull )
View billboard_sao.frag
// total number of samples at each fragment
#define NUM_SAMPLES {{ numSamples }}
#define NUM_SPIRAL_TURNS {{ numSpiralTurns }}
#define USE_ACTUAL_NORMALS {{ useActualNormals }}
#define VARIATION {{ variation }}
uniform sampler2D sGBuffer;
cdave1 / gist:e21160c63977ffe6f616
Created May 12, 2014
Pure fragment shader -- circle pattern
View gist:e21160c63977ffe6f616
// circles by @davidppp
#ifdef GL_ES
precision mediump float;
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
You can’t perform that action at this time.