Skip to content

Instantly share code, notes, and snippets.

View ctcherry's full-sized avatar
🎯
Rusty Gopher

Chris Cherry ctcherry

🎯
Rusty Gopher
View GitHub Profile
@ctcherry
ctcherry / ringo.rs
Last active June 28, 2023 20:58 — forked from timClicks/ringo.rs
Ring buffer implementation based on https://www.youtube.com/watch?v=TQVwv_e_rMw
#[derive(Debug)]
struct RingBuffer<T: Clone> {
storage: Vec<Option<T>>,
read_idx: usize,
write_idx: usize,
len: usize
}
#[derive(Debug, PartialEq)]
struct Full;
@ctcherry
ctcherry / GIT Memory Issue global
Created October 15, 2019 18:12 — forked from radermacher/GIT Memory Issue
GIT: If run into memory issue on server or local, reduce memory usage by
git config --global core.packedGitWindowSize 16m
git config --global core.packedGitLimit 64m
git config --global pack.windowMemory 64m
git config --global pack.packSizeLimit 64m
git config --global pack.thread 1
git config --global pack.deltaCacheSize 1m
# Source: http://uberspace.de/dokuwiki/development:git#ram-nutzung
@ctcherry
ctcherry / iOSclass
Created February 1, 2012 18:28 — forked from KruegerDesigns/ios.html.class.js
Add mobile class to html tag for mobile devices along with the mobile type if known
// adds mobile class, and mobile os to html tag
jQuery(document).ready(function($){
var deviceAgent = navigator.userAgent.toLowerCase();
if (deviceAgent.match(/(iphone|ipod|ipad)/)) {
$('html').addClass('ios');
$('html').addClass('mobile');
}
if (deviceAgent.match(/android/)) {
@ctcherry
ctcherry / gist:48519
Created January 18, 2009 01:54 — forked from Lytol/gist:45845
# Rails template for a basic project assuming the following:
#
# - SQLite for DB
# - Git for version control
#
# Based on a similar template by: Brian Smith (bsmith@swig505.com)
# Basic housekeeping
#
run "rm public/index.html"