Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / app.js
Created June 27, 2012 12:14
xhr2 + nodejs + filereader = resumable uploads
var http = require('http')
, formidable = require('formidable')
, fs = require('fs')
, qs = require('querystring')
, util = require('util')
, uploads = {};
http.createServer(function(req, res){
if(req.method == 'GET') {
if(req.url != '/favicon.ico') {
@piatra
piatra / gist:3097101
Created July 12, 2012 09:55
nodejistu error
info: Creating snapshot 0.1.0-2
info: Updating app kreator-server
info: Activating snapshot 0.1.0-2 for kreator-server
info: Starting app kreator-server
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy your application.
error:
error: Error spawning drone: no matching engine found
error: Repository configuration
@piatra
piatra / gist:3186566
Created July 27, 2012 06:57 — forked from rmurphey/gist:3185390
shiftOut in javascript
var five = require("johnny-five"),
board;
board = new five.Board();
board.on("ready", function() {
(new five.Led(13)).on();
var dataPin = 2;
var clockPin = 3;
@piatra
piatra / index.html
Created July 27, 2012 19:52
music player in the browser
<!doctype html public "✰">
<html>
<head>
<title>music player</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:600' rel='stylesheet' type='text/css'>
<style>
body {
font-family:'Open Sans';
font-weight: 600;
-webkit-animation:bg 30s;
@piatra
piatra / dabblet.css
Created July 31, 2012 11:03
CSS Box model demo
/**
* CSS Box model demo
*/
#box {
width: 400px;
height: 360px;
border-width: 20px;
/box-sizing: border-box;
}
@piatra
piatra / dabblet.css
Created August 12, 2012 19:27
Untitled
body {
padding:100px;
}
input:checked ~ p.first {
display:none;
}
input:not(:checked) ~ p.second {
display:none;
@piatra
piatra / dabblet.css
Created September 3, 2012 18:48
Untitled
body {
padding:100px;
}
input:checked ~ p.first {
display:none;
}
input:not(:checked) ~ p.second {
display:none;
@piatra
piatra / dabblet.css
Created November 1, 2012 21:23
Untitled
.ball {
background:lightgreen;
background:-webkit-linear-gradient(#222, lightgreen);
width:200px;
height:200px;
border-radius:50%;
position:absolute;
left:0;
}