Skip to content

Instantly share code, notes, and snippets.

View creaux's full-sized avatar
:octocat:

Petr Juna creaux

:octocat:
View GitHub Profile
@creaux
creaux / cloudSettings
Last active April 6, 2022 08:57
Visual Studio Code Settings Sync Gist
{"lastUpload":"2022-04-06T08:57:41.429Z","extensionVersion":"v3.4.3"}
@creaux
creaux / server.js
Created September 28, 2016 10:43
Static server for serving files from the same path.
import express from 'express';
const app = express();
app.use(express.static(__dirname));
app.listen(8083, () => {
console.log('Static server is runing on port 8083');
});
#!/bin/bash
#
# Check package.json and npm install after git checkout.
# Put this to .git/hooks/post-checkout
#
PREVIOUS_HEAD=$1
NEW_HEAD=$2
BRANCH_SWITCH=$3
@creaux
creaux / xdebug_installation.md
Created June 3, 2016 20:55 — forked from joseluisq/xdebug_installation.md
Install PHP Xdebug on Fedora / CentOS x64

PHP Xdebug installation on Fedora/CentOS x64

First, install xdebug package on system:

$ sudo yum install php-pecl-xdebug.x86_64

Or with DNF:

@creaux
creaux / cdn.html
Last active May 26, 2016 15:49
HTML5 Skeleton
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css">
@creaux
creaux / rx.firebase.js
Created March 6, 2016 16:29 — forked from gsoltis/rx.firebase.js
Quick Firebase / RxJS binding prototype
(function () {
var makeCallback = function(eventType, observer) {
if (eventType === 'value') {
return function(snap) {
observer.onNext(snap);
};
} else {
return function(snap, prevName) {
// Wrap into an object, since we can only pass one argument through.
observer.onNext({snapshot: snap, prevName: prevName});
@creaux
creaux / test.js
Created November 11, 2015 17:18
Context of current class decorator
test
@creaux
creaux / decorator.js
Created November 11, 2015 11:15
Handle this as part of object scope
test
@creaux
creaux / angular-component.js
Last active November 11, 2015 22:20
Angular Component
// Angular js foo module declaration
// which is later instantiated in html
var foo = angular.module('foo', []);
// Let's declare new angular hello component
foo.component('hello', {
// Use template
template: '<h3> {{ hello.message }} </h3>',
@creaux
creaux / inject-controller.js
Last active November 11, 2015 22:20
Angular tets
describe('Declare inject controller', function() {
// 1. Prerequisities
// Variables which are avalaible on parent scope
var $controller,
ctrl,
serviceMock;
// 2. We are using module foo because it contains desired controller