Skip to content

Instantly share code, notes, and snippets.

View TyOverby's full-sized avatar
😸

Ty Overby TyOverby

😸
View GitHub Profile
Hello World
Error extracting zip entry 'scala/sys/process/0004-ProcessImpl$SequentialProcess$$anonfun$runAndExitValue$5$$anonfun$apply$3.js.map' to '/media/sf_Ty/workspace/Personal/Scala/Pipe/math/target/streams/compile/externalDependencyClasspath/$global/package-js/extracted-jars/scalajs-library_2.10-0.3.jar--627bf5f9/scala/sys/process/0004-ProcessImpl$SequentialProcess$$anonfun$runAndExitValue$5$$anonfun$apply$3.js.map': java.io.FileNotFoundException: /media/sf_Ty/workspace/Personal/Scala/Pipe/math/target/streams/compile/externalDependencyClasspath/$global/package-js/extracted-jars/scalajs-library_2.10-0.3.jar--627bf5f9/scala/sys/process/0004-ProcessImpl$SequentialProcess$$anonfun$runAndExitValue$5$$anonfun$apply$3.js.map (Operation not permitted)
at sbt.ErrorHandling$.translate(ErrorHandling.scala:11)
at sbt.IO$.next$1(IO.scala:215)
at sbt.IO$.sbt$IO$$extract(IO.scala:230)
at sbt.IO$$anonfun$unzipStream$1.apply(IO.scala:193)
at sbt.IO$$anonfun$unzipStream$1.apply(IO.scala:193)
@TyOverby
TyOverby / db_wrapper.js
Last active August 29, 2015 13:57
DB js
var dblib = require('somedb');
var wr = require('mywrapper');
var db = wr(dblib);
// query
function queryExample() {
var client = yield db.connect('postgres://postgres:1234@localhost/postgres');
var table = yield client.getTable('users');
$ rustc image.rs
image.rs:42:9: 43:6 error: cannot infer an appropriate lifetime for autoref due to conflicting requirements
image.rs:42 self.pixels.as_mut_slice()
image.rs:43 }
image.rs:42:9: 42:20 note: first, the lifetime cannot outlive the expression at 42:8...
image.rs:42 self.pixels.as_mut_slice()
^~~~~~~~~~~
image.rs:42:9: 42:20 note: ...so that automatically reference is valid at the time of borrow
image.rs:42 self.pixels.as_mut_slice()
@TyOverby
TyOverby / image.rs
Created March 24, 2014 02:30
A simple self-contained module for creating image processing
use std::clone::Clone;
use std::default::Default;
use std::io;
// A simple view into an image.
// Has getters for the width and height and
// a method for retrieving a pixel at a
// particular position.
trait View<Color> {
fn width(&self) -> uint;
@JSExport
object ScalaJSExample{
@JSExport
def main(args: Array[String]): Unit = {
rgl::push_matrix(|glm| {
glm.scale(1, 2, 1);
rgl::begin(rgl::DrawType::Triangles, |gld| {
gld.push_vertex3f(1.0, 0.0, 0.0);
gld.push_vertex3f(0.0, 1.0, 0.0);
gld.push_vertex3f(0.0, 0.0, 1.0);
});
});
// Also include rgl::unsafe::(scale / push_vertex3f) etc.
unresolved name
let id = C::id();
I obviously can't write
let id = Component::id() because it would be ambiguous.
#![feature(macro_rules)]
use std::any::Any;
use std::any::AnyRefExt;
macro_rules! match_any(
($val:expr match $(if $typ:ty { $($patn: pat => $exp: expr),+ }),+ else { $other: expr}) => (
{
$(
@TyOverby
TyOverby / .tmux.conf
Last active August 29, 2015 14:02
My Tmux configuration
# Get rid of the stupid ctrl-b binding
unbind C-b
unbind l
# set the prefix to ctrl-a instead
set -g prefix C-a
bind-key C-a last-window
bind r source-file ~/.tmux.conf