Skip to content

Instantly share code, notes, and snippets.

View szalonna's full-sized avatar
:shipit:

József Sebestyén szalonna

:shipit:
  • Instructure
  • Budapest, Hungary
  • 14:28 (UTC +02:00)
View GitHub Profile
@ticking-clock
ticking-clock / App.coffee
Last active July 25, 2016 21:44
Ember.js classes for client-server web socket communication
'use strict'
@App = Ember.Application.create
LOG_TRANSITIONS: true
ready: ->
console.log "app ready, starting server"
@set 'server', App.EventedServer.create
url: '192.168.1.101:8888/game'
delegateType: App.FixtureWebSocket
@azu
azu / promise-thenable.js
Created April 5, 2014 16:18
Web Notifications as promise
"use strict";
function notifyMessage(message) {
return new Promise(function (resolve, reject) {
if (Notification.permission === "granted") {
var notification = new Notification(message);
return resolve(notification);
} else if (Notification) {
Notification.requestPermission(function (status) {
if (Notification.permission !== status) {
Notification.permission = status;
anonymous
anonymous / jsbin.vaqaxegi.css
Created March 15, 2014 22:08
body{
background-color: #2C3E50;
}
#clock{
display: block;
width: 600px;
height: 600px;
margin: 0 auto;
}
@willurd
willurd / web-servers.md
Last active May 23, 2024 08:59
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');