Skip to content

Instantly share code, notes, and snippets.

@Asimov4
Asimov4 / lambda-dynamo
Last active November 7, 2015 05:28 — forked from markusklems/lambda-dynamo
Short aws lambda sample program that puts an item into dynamodb
// create an IAM Lambda role with access to dynamodb
// Launch Lambda in the same region as your dynamodb region
// (here: us-east-1)
// dynamodb table with hash key = user and range key = datetime
console.log('Loading event');
var doc = require('dynamodb-doc');
var dynamodb = new doc.DynamoDB();
exports.handler = function(event, context) {
@Asimov4
Asimov4 / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../topeka-elements/category-icons.html">
<polymer-element name="my-element">
<template>
@Asimov4
Asimov4 / resume_after_next.md
Created February 17, 2014 03:39 — forked from mikedeboer/resume_after_next.md
Why to call resume() after next()

When we write Connect middlewares that contain async operations, it is good practice to 'pause' the HTTP request with the help of the Connect utility function. When the async operation has finished, the HTTP request is resumed again. Let's have a look at the documentation for this utility:

Pause `data` and `end` events on the given `obj`.
Middleware performing async tasks _should_ utilize
this utility (or similar), to re-emit data once
the async operation has completed, otherwise these
events may be lost.
// ==UserScript==
// @name Amazon Auto-Smile
// @namespace
// @version 0.1
// @description Automatically redirects all www.amazon.com URLs to their smile.amazon.com equivalent.
// @match http://www.amazon.com/*
// @match https://www.amazon.com/*
// @run-at document-start
// @copyright 2013
// ==/UserScript==
@Asimov4
Asimov4 / makehub
Created December 22, 2013 08:21 — forked from eldraelin/makehub
TURBO
# Title
TURBO
# Picture
media: http://oblikon.net/wp-content/uploads/turbo-course.jpg
# Objective
The world fastest snail
# Duration
10
# Age Group
all
@Asimov4
Asimov4 / makehub
Created December 9, 2013 01:02 — forked from stefania11/makehub
Moss oscilator
# Title
Moss oscilator
# Picture
media: http://s24.postimg.org/3pqmzrp5h/Screen_Shot_2013_11_30_at_2_26_50_AM.png
# Objective
Building a 'Mosscillator' - a mixture of moss and oscillator. By touching moss the organic structures of moss are decreasing conductivity and can be therefore used as pressure sensor. The touch of moss will control sounds and noises generated by an oscillator chip.This way we can make a moss symphony together, consisting of several Mosscillators created during the workshop
# Duration
40
# Age Group
all
git diff --cached
git pull --rebase
git rebase -i HEAD~4
git add -u
git commit --amend
git push origin fefc50f:mainline # to push a single commit
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
git config --global alias.lgp "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -p"
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
@Asimov4
Asimov4 / Django Bitnami cheat sheet
Last active December 14, 2015 15:39
Django Bitnami cheat sheet
restart apache
sudo /opt/bitnami/ctlscript.sh restart apache
http://raamdev.com/2007/recovering-from-ctrls-in-putty/
https://docs.djangoproject.com/en/dev/intro/tutorial03/
@Asimov4
Asimov4 / Caml test
Created April 14, 2012 00:45
Caml test
let altitude = fun n ->
let t = make_matrix (n+2) (n+2) 0 in
for i=1 to n do
for j=1 to n do
t.(i).(j) <- 2
done;
done;
t.(n).(n) <- 1;
let rec aux = fun (u,v) -> match (u,v) with
(u,v) when t.(u).(v) != 2 -> t.(u).(v)