Skip to content

Instantly share code, notes, and snippets.

View cloudwalking's full-sized avatar
🤠

Reed morse cloudwalking

🤠
View GitHub Profile
/*
---
name: guilloche
script: guilloche.js
description: guilloche
provides: [Guilloche]
...
*/
@cloudwalking
cloudwalking / new_bashrc.sh
Created August 11, 2012 08:41 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful.
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
# Symlink all of the following to this file:
# * ~/.bashrc
@cloudwalking
cloudwalking / gist:8396629
Created January 13, 2014 08:39
ffmpeg photo sequence to video
ffmpeg -r 25 -start_number 59696 -i G00%d.JPG -pattern_type sequence -s 1920x1080 -vcodec libx264 -crf 18 video.mkv
@cloudwalking
cloudwalking / Cache.m
Created October 16, 2014 16:54
Cache
#import <CommonCrypto/CommonDigest.h>
#import "Cache.h"
@implementation Cache
+ (void)cacheObject:(id)object forKey:(NSString *)key {
NSString *path = [self pathForKey:key];
[NSKeyedArchiver archiveRootObject:object toFile:path];
}
@cloudwalking
cloudwalking / CachedImageView.m
Created October 16, 2014 16:57
CachedImageView
#import "CachedImageView.h"
#import "Cache.h"
@implementation CachedImageView
- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
self.contentMode = UIViewContentModeScaleAspectFill;
self.clipsToBounds = YES;
UIView *videoView = [[UIView alloc] init];
...
AVCaptureSession *session = [[AVCaptureSession alloc] init];
AVCaptureVideoPreviewLayer *previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session];
previewLayer.frame = videoView.bounds;
[videoView.layer addSublayer:previewLayer];
[session startRunning];
#include "FastLED.h"
CRGB leds[16];
void setup() { FastLED.addLeds<NEOPIXEL, 1>(leds, 16); }
void loop() {
static uint8_t hue = 0;
FastLED.showColor(CHSV(hue++, 255, 255));
delay(10);
}
#include <SPI.h>
#include "LPD8806.h"
// LED parameters:
#define LED_COUNT 16
#define DATA_PIN 6
#define CLOCK_PIN 12
LPD8806 strip;