Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am thinkdevcode on github.
  • I am thinkdevcode (https://keybase.io/thinkdevcode) on keybase.
  • I have a public key whose fingerprint is F30A D42B 3B3A 14CE DDF1 8094 2803 1773 6C0E 73BD

To claim this, I am signing this object:

@thinkdevcode
thinkdevcode / spirals.js
Created January 7, 2016 03:42
spirals, how do they work?
"use strict";
let directions = [[-1,0], [0,1], [1,0], [0,-1]];
function spiral(n) {
let matrix = [], total = n * n;
let x = 0, y = 0, val = 1;
/// initialize matrix
for (let i = 0; i < n; i++)
public class Main : NancyModule
{
public Main()
: base("/v1/vision")
{
Get["/{dbo}/{table}"] = _ =>
{
var db = Database.OpenNamedConnection("VisionDev");
int page = (Request.Query.page) ? Request.Query.page : 1;
List<dynamic> list = db[_.dbo][_.table].All().Skip(page * 20).Take(20).ToList();
@thinkdevcode
thinkdevcode / gist:4106633
Created November 18, 2012 18:18
Route53 create record set example
r53 = AWS::Route53.new(
:access_key_id => 'KEY_ID',
:secret_access_key => 'ACCESS_KEY')
host_zone_id = "ZONE_ID"
resp = r53.client.change_resource_record_sets({ :hosted_zone_id => host_zone_id, :change_batch => {
:comment => "Creating new subdomain for user: #{name}", :changes => [{
:action => "CREATE", :resource_record_set => {
@thinkdevcode
thinkdevcode / gist:4014184
Created November 4, 2012 22:52
rubymotion broken
class MainController < UIViewController
def viewDidLoad
setupVideo()
end
def setupVideo
@session = AVCaptureSession.alloc.init
@session.sessionPreset = AVCaptureSessionPresetLow
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Pexelu</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="stylesheet" href="http://bootswatch.com/cerulean/bootstrap.min.css" type="text/css" media="screen">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->