Skip to content

Instantly share code, notes, and snippets.

View rhalff's full-sized avatar

Robbert Halff rhalff

  • Robbert Halff
  • Netherlands
View GitHub Profile
{
"@context": "context.jsonld",
"@graph": [
{
"@id": "_:g70333128676980",
"@type": "ContactPoint",
"name": "Macháček",
"telephone": "+420 728 585 881",
"type": {
"@value": "Kontaktní osoba",

Usage

Install cordova into node_modules

npm install cordova

Add icons_and_splash.js

@rhalff
rhalff / app.js
Created June 4, 2014 09:17 — forked from skypanther/app.js
var Utils = {
/* modified version of https://gist.github.com/1243697
* adds detection of file extension rather than hard-coding .jpg as in the original
*/
_getExtension: function(fn) {
// from http://stackoverflow.com/a/680982/292947
var re = /(?:\.([^.]+))?$/;
var tmpext = re.exec(fn)[1];
return (tmpext) ? tmpext : '';
},
// Mocked Service
angular.module('mock.users', []).
factory('UserService', function($q) {
var userService = {};
userService.get = function() {
return {
id: 8888,
name: "test user"
}

ReactJS Component Cheatsheet

To create a ReactComponent:

ReactComponent React.createClass(object proto)

Basic JSX example:

var TitleComponent = React.createClass({

// REQUIRED

@rhalff
rhalff / addsqlite.sh
Last active August 29, 2015 14:15 — forked from botris/addsqlite.sh
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
@rhalff
rhalff / after.sh
Last active August 29, 2015 14:21 — forked from cluppi/after.sh
#!/bin/sh
# Config for SSL.
echo "--- Making SSL Directory ---"
mkdir /etc/nginx/ssl
echo "--- Copying $i SSL crt and key ---"
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com"
echo "--- Turning SSL on in nginx.conf. ---"

Laravel Homestead XDebug Nginx and Composer config changes

/etc/nginx/fastcgi_params

Update nginx config to support a longer timeout to prevent it dropping the connection when trying to debug in PHP Storm

fastcgi_read_timeout 600; # Set fairly high for debugging
# .config/i3/config
set $mod Mod4
set $alt Mod1
font pango:Segoe UI 8
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# class border backgr. text
@rhalff
rhalff / destructuring.js
Created October 28, 2015 09:49 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring.
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => {
return [1, 2, 3];