Skip to content

Instantly share code, notes, and snippets.

View asciidisco's full-sized avatar
🏠
Working from home

Sebastian Golasch asciidisco

🏠
Working from home
View GitHub Profile
@asciidisco
asciidisco / chat.js
Created December 2, 2011 15:13
NodeChat
// Module dependencies.
var express = require('express')
, stylus = require('stylus')
, nib = require('nib')
, sio = require('socket.io')
, app = null;
// Create application server
app = express.createServer();
@asciidisco
asciidisco / cssminex
Created June 3, 2012 10:02
CSSMin example
cssmin: {
build: {
src: ['src/css/boilerplate_top.css', 'src/css/ui/jquery.ui.base.css', 'src/css/ui/jquery.ui.theme.css', , 'src/css/ui/jquery.ui.slider.css', 'src/css/ui/jquery.ui.core.css', 'src/css/jquery.jscrollpane.css', 'src/css/screen.css', 'src/css/slider.css', 'src/css/boilerplate_bottom.css'],
dest: 'build/css/main.css'
}
},
min : {
build: {
src: ['src/js/jquery.js', 'src/js/plugins.js'],
dest: 'build/js/all.js'
@asciidisco
asciidisco / iot.md
Created July 4, 2012 15:53
Image optimization tools (losless)

I want your lossless image optimization tool knowlegde:

Note: I´am looking for cmd tools (preferred running on mac/linux/win - but it´s not a must) Online services are welcome as well. If you have a good article, stackoverflow post or smth. else on image optimization (with statistics & stuff), i would appriciate if you could share that, too.

Already suggested:

@asciidisco
asciidisco / ga.txt
Created September 10, 2012 09:09
Grunt absract
Nowadays frontend developers have to deal with topics & tools that they´ve never encountered before: unit testing, code linting, minification, code modularization, etc. ...
Those who done it know, setting everything up and maintaining it is a pain that costs
hours of working time.
But that´s not true anymore; thanks to Grunt, we now have a frontend specific build tool that eliminates most of hard work.
During this talk we will learn how to setup grunt, learn to use it in a real world project and discover it´s ecosystem with plenty of written plugins.
@asciidisco
asciidisco / pijs.js
Created September 10, 2012 18:25
"Privates" in JS
// Defining "private" properties in JavaScript
// define youre own scope by using an
// immediate executed function
(function (){
// x is only be visible within this scope a.k.a this function
var x = null;
var Bla = function(blup) {
@asciidisco
asciidisco / pubsub_with_requirejs_backbone.js
Created October 31, 2012 11:26
PubSub with requirejs & backbone
// PubSub impl. with require.js & backbone.js
// events.js
define(['underscore', 'backbone'], function (_, Backbone) {
'use strict';
var events = {};
_.extend(events, Backbone.Events);
return events;
});
@asciidisco
asciidisco / getTitle.js
Created January 31, 2013 16:19
Access PhantomJS via WebDriver/JSONWireProtocol from node to receive the title of a webpage
// before you launch this script, make sure you have phantomjs v1.8 installed
// and launch it with the port specified in the options: ´$ phantomjs --webdriver=3456´
var http = require('http');
// request body for "/wd/hub/session" request
var body = JSON.stringify({desiredCapabilities: {browserName: 'firefox', version: '', platform: 'ANY'}});
// base options for post requests
var options = {
// de-de
{
// Appbar commands
, "MyLocation" : "Mein Standort"
, "MyLocationTooltip" : "Finde deinen aktuellen Standort"
, "GetAllCars" : "Zeige alle Autos"
, "GetAllCarsTooltip" : "Finde alle verfügbaren car2go Fahrzeuge"
, "ShowParking" : "Zeige mir einen Parkplatz"
, "ShowParkingTooltip" : "Zeige mir alle car2go Parkplätze"
@asciidisco
asciidisco / dalek_iframe_login_TEST.js
Last active December 17, 2015 01:59
Test login in embedded iframe that is also protected by http auth
module.exports = {
// name of the suite
name: 'some super secret project login test',
// Can log in @portal, go to dashbaord, and can go further from there
'can log in @portal': function (test) {
'use strict';
test.expect(3)
.setHttpAuth('username', 'password')
@asciidisco
asciidisco / dalek_vimeo_login_TEST.js
Last active December 17, 2015 01:59
DalekJS login test (vimeo testcase)
module.exports = {
'can log in at vimeo': function (test) {
'use strict';
test.expect(1)
.open('http://vimeo.com/log_in')
.type('#email', 'foo@bar.com')
.type('#password', 'baz')
.click('.submit .btn')
.assert.text('#page_header h1 a', 'foobar')