Skip to content

Instantly share code, notes, and snippets.

@jethrogb
jethrogb / coordinate.rs
Last active August 17, 2021 10:08
Custom Diesel wrapper type example
/// This defines a custom Diesel type for storing a 6-bit integer and a 58-bit
/// integer in the same 64-bit SQL column
use std::error::Error;
use std::fmt;
use std::io::Write;
use diesel::backend::Backend;
use diesel::types::{FromSqlRow,FromSql,ToSql,HasSqlType,IsNull,BigInt,Nullable};
use diesel::expression::AsExpression;
use diesel::row::Row;
@PhilKershaw
PhilKershaw / gist:2171814
Created March 23, 2012 15:31
Simple example of using 2-legged OAuth in Node.js (requires node-oauth)
var express = require('express');
var oauth = require('oauth');
var app = express.createServer();
var key = "[api-key]";
var secret = "[api-secret]";
var request = new oauth.OAuth(null, null, key, secret, '1.0', null, 'HMAC-SHA1');
app.get('/api-request', function(req, res){
request.get(
"http://127.0.0.1:8000/api/1.0/data.json",

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables