Skip to content

Instantly share code, notes, and snippets.

View sbeckeriv's full-sized avatar
🐢
Horray another status box

Stephen Becker IV sbeckeriv

🐢
Horray another status box
  • Death By Escalator
  • Seattle
View GitHub Profile
@sbeckeriv
sbeckeriv / GIF-Screencast-OSX.md
Created October 26, 2017 16:22 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

macro_rules! externs {
( $( $x:ident ),* ) => {
$(
extern crate $x;
)*
};
}
externs![rocket, rocket_contrib, serde_json,
chrono, dotenv, postgres, r2d2,
#[derive(Serialize,Associations, Identifiable, Deserialize, Queryable, Debug, Clone)]
#[table_name = "places"]
#[has_many(inspections)]
pub struct Place {
pub id: i32,
pub name: String,
pub program_identifier: String,
pub description: Option<String>,
pub phone: Option<String>,
pub address: String,
use diesel;
use diesel::prelude::*;
use diesel::pg::PgConnection;
use dotenv::dotenv;
use std::env;
use schema::inspections;
use schema::inspections::dsl::inspections as all_inspections;
use schema::places;
use schema::places::dsl::places as all_places;
@sbeckeriv
sbeckeriv / hell0.js
Created November 5, 2016 16:15
rust js
This file has been truncated, but you can view the full file.
// The Module object: Our interface to the outside world. We import
// and export values on it, and do the work to get that through
// closure compiler if necessary. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..generated code.. }
// 3. pre-run appended it, var Module = {}; ..generated code..
// 4. External script tag defines var Module.
// We need to do an eval in order to handle the closure compiler
// case, where this code here is minified but Module was defined
// elsewhere (e.g. case 4 above). We also need to check if Module
@sbeckeriv
sbeckeriv / ex
Created September 19, 2016 16:04
example
I checked out your repo under examples folder in helix
$ ~/trash/helix/examples/case_transform[master]: pwd
/Users/becker/trash/helix/examples/case_transform
$ ~/trash/helix/examples/case_transform[master]: rustc --version
rustc 1.13.0-nightly (32571c05c 2016-09-17)
$ ~/trash/helix/examples/case_transform[master]: ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
$ ~/trash/helix[master*]: cargo build --release
Compiling libc v0.2.11
Compiling image_gen v0.1.0 (file:///Users/becker/trash/image_gen)
src/main.rs:25:26: 25:41 error: the trait bound `&image::ImageBuffer<image::Rgba<u8>, std::vec::Vec<u8>>: img_hash::HashImage` is not satisfied [E0277]
src/main.rs:25 let generated_hash = ImageHash::hash(&generated, 8, HashType::Gradient);
^~~~~~~~~~~~~~~
src/main.rs:25:26: 25:41 help: run `rustc --explain E0277` to see a detailed explanation
src/main.rs:25:26: 25:41 help: the following implementations were found:
src/main.rs:25:26: 25:41 help: <image::ImageBuffer<image::Luma<u8>, std::vec::Vec<u8>> as img_hash::HashImage>
src/main.rs:25:26: 25:41 help: <image::ImageBuffer<image::LumaA<u8>, std::vec::Vec<u8>> as img_hash::HashImage>
src/main.rs:25:26: 25:41 help: <image::ImageBuffer<image::Rgb<u8>, std::vec::Vec<u8>> as img_hash::HashImage>
src/main.rs:25:26: 25:41 help: <image::ImageBuffer<image::Rgba<u8>, std::vec::Vec<u8>> as img_hash::HashImage>
@sbeckeriv
sbeckeriv / main.rs
Created June 3, 2016 06:00
rust scraping
extern crate curl;
use curl::easy::Easy;
use std::error::Error;
use std::io::prelude::*;
use std::fs::File;
use std::path::Path;
// Print a web page onto stdout
fn main() {
// _IMAGE AUTHENTICATION FOR A SLIPPERY NEW AGE_
//by Steve Walton
//Listing One
// <sealimg.c>
// Copyright 1994 by Steve Walton
//
// This implementation measures checksums using all of the upper 7 bits of each
$ ~/trash/rust-algorithms/chapter-1/3/max_stack[master*]: cargo build
Compiling max_stack v0.1.0 (file:///Users/becker/trash/rust-algorithms/chapter-1/3/max_stack)
src/stackable.rs:34:1: 41:2 error: the trait `core::iter::Iterator` is not implemented for the type `stackable::MaxStackIterator<T>` [E0277]
src/stackable.rs:34 impl<T> IntoIterator for MaxStack<T> {
src/stackable.rs:35 type Item = T;
src/stackable.rs:36 type IntoIter = MaxStackIterator<T>;
src/stackable.rs:37
src/stackable.rs:38 fn into_iter(self) -> MaxStackIterator<T> {
src/stackable.rs:39 MaxStackIterator::new(self)
...