Skip to content

Instantly share code, notes, and snippets.

Nick Goris nckg

  • Pixeo
  • Belgium
Block or report user

Report or block nckg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nckg
nckg / valet.conf
Created May 31, 2018 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
View valet.conf
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@nckg
nckg / gist:1da0f34d1ead72c02323585509b5c2bb
Last active Jun 2, 2018
Setup raspberry Pi 3 (ubuntu server, php7.2, nginx) with Terraform
View gist:1da0f34d1ead72c02323585509b5c2bb
# https://jtway.co/ubuntu-server-16-06-on-raspberry-pi-3-via-terraform-93dccaef5ddb?gi=e5fcb8404a4d
variable "server_ip" {
default = "SERVER IP ADDRESS"
}
# Terraform documentation
# * Provisioner null_resource: https://www.terraform.io/docs/provisioners/null_resource.html
# * Provisioner Connections: https://www.terraform.io/docs/provisioners/null_resource.html
@nckg
nckg / takeAtLeast.js
Last active Aug 11, 2017
Extends Promise with a new property. Tells the Promise to take at least a minimum of given time before returning it
View takeAtLeast.js
/**
* Extends Promise with a new property. Tells the Promise to take at least a minimum of given time.
*
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/prototype
*
* Example:
*
* var p = new Promise(function (resolve, reject) { ... });
* p.takeAtLeast(1000).then(function () { ... });
*/
@nckg
nckg / InputEdit.vue
Created Jun 13, 2017
Vue Inline edit
View InputEdit.vue
<template>
<div>
<span v-show="!editing"
@click="toggleEdit" v-html="showValue"></span>
<div v-show="editing" class="row">
<div class="col-md-10">
<div class="form-group">
<textarea class="form-control"
rows="3"
@nckg
nckg / import.php
Created Sep 28, 2012
Creates a SQL file with a simple sql `insert` statement from a .csv
View import.php
#!/usr/bin/env php
<?php
setlocale(LC_ALL, 'nl_BE.UTF8');
$handle = fopen("test.csv", "r");
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
array_pop($data);
array_walk($data, 'wrapItem');
$sql[] = 'INSERT INTO src_leaseplandb VALUES (' . implode(', ', $data) . ');';
@nckg
nckg / UpdateCSS.js
Created Aug 24, 2012 — forked from tomclaus/UpdateCSS.js
Run this jQuery script to update your css. Be creative and create a bookmarklet from it ;-)
View UpdateCSS.js
$("link[rel=stylesheet]").each(function(){
var url = $(this).attr('href');
url = url.replace(/\?tcnc=\d+/,'').replace(/\&tcnc=\d+/,'');
url += (url.indexOf('?')>0 ? '&' : '?') + 'tcnc=' + (new Date()).getTime();
$(this).attr('href', url);
console.log('[UPDATED CSS] '+ url);
});
@nckg
nckg / gist:3245722
Created Aug 3, 2012
Lambert-72 (EPSG:31370) definition for Proj4js
View gist:3245722
Proj4js.defs["EPSG:31370"] = "+proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1 +units=m +no_defs";
View multiview.rb
# Makes Sinatra support multiple view paths.
# Usage:
#
# class Main < Sinatra::Base
# register Sinatra::MultiView
#
# get '/' do
# locals = { :name => current_user.name }
#
# # Instead of `haml 'home', {}, locals`
@nckg
nckg / osx_lion_rail_setup.md
Created Mar 27, 2012 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
View osx_lion_rail_setup.md
You can’t perform that action at this time.