Skip to content

Instantly share code, notes, and snippets.

@dlsym
dlsym / gist:7705448
Created November 29, 2013 13:04
Show HN: Pick a number from 1 to 1000 in C.
/**
* Pick a number from 1 to 1000 in C
*
* Copyright (c) 2013 My little startup I hate to love.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
@dlsym
dlsym / time.sh
Created August 8, 2012 11:48
Add time for bash
#!/bin/bash
#
# Add two "H:M:S" times
# (c) 2012 @dlsym
#
#
# Time to seconds
function t2s {
div=3600; ts=0
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define WIDTH 10
int main()
{
int field[WIDTH][WIDTH];
var TeaTime = function( year, month, day, hour, minute, second ) {
this.year = year; this.month = month; this.day = day;
this.hour = hour; this.minute = minute; this.second = second;
var start = new Date(
this.year, this.month-1, this.day,
this.hour, this.minute, this.second
);
var now = new Date();
var start = moment("2012-02-15 20:00:00 GMT");
var stop = moment();
console.log( moment( stop.diff( start )).format( 'HH:mm:ss') );
@dlsym
dlsym / gist:1811115
Created February 12, 2012 22:13 — forked from anonymous/gist:1809681
ePirat - pastebin.com/L9P7vTVN
var http = require('http');
var url = require('url');
var accumulate = new Object;
var Boxcar = [];
var notifo = [];
accumulate.events = [];
var counter = 9;
// Configuration
// Interval to check if liveshow starts in 15 Minutes