Skip to content

Instantly share code, notes, and snippets.

@piatra
piatra / app.js
Created June 7, 2012 08:59 — forked from max-mapper/app.js
github oauth with tako and leveldb
var path = require('path')
var tako = require('tako')
var gist = require('gist')
var request = require('request')
var qs = require('querystring')
var leveldb = require('leveldb')
var https = require('https')
var htmldir = path.resolve(__dirname, 'attachments')
@piatra
piatra / index.js
Created May 21, 2012 20:52
getting gist from github in an archive
var request = require('request')
, express = require('express')
, app = express.createServer().listen(8000)
, slides = []
, data = ''
, zip = require("node-native-zip")
;
app.get('/', function(req, res){
// what needs to be done: fetch files from github, concatenate, arhive and send to user
@piatra
piatra / 1.txt
Created May 17, 2012 09:19
reveal.js
<section>
Hello world 1
</section>
@piatra
piatra / index.html
Created April 29, 2012 11:47
Record stream from getUserMedia() stream
<!DOCTYPE HTML>
<html>
<head>
<title>Video recording demo</title>
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
@piatra
piatra / css loading
Created February 20, 2012 19:50
css load loading snippet
body.loading { cursor: wait; }
@piatra
piatra / show hide agenda de deputati
Created February 18, 2012 11:28
show hide for Agenda de deputati
var $senator = $('.office-senator')
, $deputat = $('.office-deputy');
$('select').click(function(){
var value = $(this).val().trim();
if(value == 'all') {
$senator.show();
$deputat.show();
}
if(value == 'office-deputy') {
@piatra
piatra / node restarter
Created February 15, 2012 21:28
Restart node server where changes are made to server file
#! /bin/bash
if [[ -f ./$1 ]]; then
while true; do
time=$(stat -c %Y server.js | cut -d ' ' -f1);
oldtime=$(cat log);
if [[ "$oldtime" -lt "$time" ]]
then
if [[ $pid -gt 0 ]]; then
node server &
@piatra
piatra / dabblet.css
Created February 12, 2012 20:05
TV screen
/**
* TV screen
*/
html { background: white; }
.tv {
position: relative;
width: 200px;
@piatra
piatra / dabblet.css
Created February 12, 2012 20:04 — forked from LeaVerou/dabblet.css
TV screen
/**
* TV screen
*/
html { background: white; }
.tv {
position: relative;
width: 200px;
height: 150px;
@piatra
piatra / dabblet.css
Created February 12, 2012 20:04 — forked from LeaVerou/dabblet.css
TV screen
/**
* TV screen
*/
html { background: white; }
.tv {
position: relative;
width: 200px;
height: 150px;