Skip to content

Instantly share code, notes, and snippets.

View JumpLink's full-sized avatar
🚫
shhh quiet, I am working

Pascal Garber JumpLink

🚫
shhh quiet, I am working
View GitHub Profile
@JumpLink
JumpLink / index.spec.ts
Last active December 28, 2017 18:29
Server application in TypeScript with Koa
// example code for this tutorial: https://jumplink.eu/blog/post/serveranwendung-direkt-typescript-entwickeln-und-testen
import 'mocha';
import ChaiHttp = require('chai-http');
import * as chai from 'chai';
chai.use(ChaiHttp);
describe('test route', function() {
it('should response with status 200', function(done) {
@JumpLink
JumpLink / mdDraggableSidenav.js
Last active December 21, 2015 13:12
Replace the orginal mdSidenav directive with a draggable Sidenav from this commit: https://github.com/angular/material/pull/6174
// take this sidenav and overwrite the original: https://github.com/angular/material/pull/6174
/* jshint ignore:start */
/**
* @ngdoc directive
* @name mdSidenav
* @module material.components.sidenav
* @restrict E
*
* @description
@JumpLink
JumpLink / timeline-responsive.less
Created October 7, 2014 12:07
rewritten bootstrap 3 responsive timeline css for less
/* rewritten bootstrap 3 responsive timeline css for less
* source: http://bootsnipp.com/snippets/featured/timeline-responsive
*/
.timeline {
list-style: none;
padding: 20px 0 20px;
position: relative;
&:before {
top: 0;
bottom: 0;
@JumpLink
JumpLink / testUpdateSettingsConnection.js
Created July 19, 2014 11:54
org.freedesktop.NetworkManager.Settings.Connection Update
var DBus = require('dbus');
var dbus = new DBus();
var util = require('util');
var inspect = function(object) {
console.log("\n"+util.inspect(object, showHidden=false, depth=2, colorize=true)+"\n");
}
var bus = dbus.getBus('system');
var serviceName = 'org.freedesktop.NetworkManager';
var objectPath = '/org/freedesktop/NetworkManager/Settings/0'; // replace the number 0 this with your settings you want to test, you can use d-feet to pick up the right
var interfaceName = 'org.freedesktop.NetworkManager.Settings.Connection';
@JumpLink
JumpLink / language json generator
Created February 5, 2014 16:16
generates one json-file including all languages in all translations using https://github.com/staser written in node.js
// generates one json-file including all languages in all translations using https://github.com/staser
var fs = require('fs');
var langDir = __dirname+"/git/country-list/country/cldr";
var dest = __dirname+"/langs.json";
var languages = {};
fs.readdir(langDir, function(err, list) {
console.log(err);
/**
* <NameOfYourModel>Controller
*
* @module :: Controller
* @description :: A set of functions called `actions`.
*
* Actions contain code telling Sails how to respond to a certain type of request.
* (i.e. do stuff, then send some JSON, show an HTML page, or redirect to another URL)
*
* You can configure the blueprint URLs which trigger these actions (`config/controllers.js`)
@JumpLink
JumpLink / sails-php-client
Created November 6, 2013 18:11
socket-io client in php for sails.js. NOT WORKING!
<?php
require_once('HTTP/Request2.php'); // sudo pear install HTTP_Request2
require( __DIR__ . '/vendor/wisembly/elephant.io/lib/ElephantIO/Client.php');
use ElephantIO\Client as ElephantIOClient; // sudo apt-get install php5-curl
function get_cookie($request) {
$request->setMethod( HTTP_Request2::METHOD_GET);
$request->setCookieJar(true);
try {
$response = $request->send();
@JumpLink
JumpLink / dropdowns.less
Created October 24, 2013 16:03
lesscss version of bootstrap3 dropdown submenu solution (shown on mouse-over). css-version: http://firdaus.grandexa.com/2013/09/twitter-bootstrap-3-multilevel-dropdown-menu/
/* css hover version of .dropdown */
.dropdown-hover {
.dropdown ();
&:hover {
> .dropdown-menu {
display: block;
}
}