Skip to content

Instantly share code, notes, and snippets.

@shadowmint
shadowmint / unsafe version
Last active August 29, 2015 14:05
hashmap
use std::collections::HashMap;
struct Tmp {
v:String
}
impl Tmp {
fn new(value:&str) -> Tmp {
return Tmp {
v:String::from_str(value)
@shadowmint
shadowmint / vec2d.rs
Created August 6, 2014 06:59
A 2d vector prototype
use std::mem::transmute;
use std::ops::Index;
struct Vec2d {
width:uint,
values:Vec<uint>
}
struct Vec2dView {
value:uint
@shadowmint
shadowmint / tmp.js
Created July 18, 2014 03:33
Javascript plays
// Fake FAaaake
var src = '123121312322211112222';
var offset = 0;
function next() {
var rtn = offset < src.length ? src[offset] : null;
offset += 1;
return rtn;
}
function score(l1) {
@shadowmint
shadowmint / config.json
Last active August 29, 2015 14:03
Tagged post filter for Wintersmith
{
"locals": {
"url": "http://shadowmint.com",
"name": "Coffee & Code",
"owner": "shadowmint",
"description": "Code adventures with coffee~"
},
"plugins": [
"./plugins/paginator.coffee",
"./plugins/debug.js", // <------------
'use strict';
var ext = require('./.gruntExt')
module.exports = function (grunt) {
// Paths and things
ext.configure({
path: {
content: 'contents',
css: 'contents/css',
scripts: 'contents/scripts'
http.redirects:
405bourkestreet.com:
to_url: http://www.405bourkestreet.com
redirect_with_path: True
405bourkestreet.com.au:
to_url: http://www.405bourkestreet.com
redirect_with_path: True
<!-- hello-flomp component -->
<link rel="import" href="hello-gallery.html"/> <!-- Oo, we're using a subcomponent -->
<template id="hello_flomp"> <!-- Look a designer friendly template -->
<style> <!-- With encapsulated styles.... -->
hello-flomp > div {
border : 2px solid #000;
}
#![macro_escape]
/**
* Create a new T with default values.
* usage:
*
* let x:T = default!();
* let x = default!(Foo, x:1);
* let x = default!(Foo);
*/
use std::str::from_utf8;
pub enum StrTs<'a> {
StrT(&'a str),
VecT(Vec<u8>),
SliceT(&'a [u8]),
}
pub enum StrErr {
InvalidLength
@shadowmint
shadowmint / SassMeister-input.scss
Created April 29, 2014 03:54
Generated by SassMeister.com.
// ----
// Sass (v3.3.5)
// Compass (v1.0.0.alpha.18)
// ----
$mqsupport: true;
$static-bp: tablet;
$breakpoints: (
mobile: (false, 100),
tablet: (100, 200),