Skip to content

Instantly share code, notes, and snippets.

Avatar
🦴
Building

Koen van Gilst vnglst

🦴
Building
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am vnglst on github.
  • I am ka (https://keybase.io/ka) on keybase.
  • I have a public key whose fingerprint is 0F3E FA52 69A4 48A9 2737 F0A2 7002 3488 303A CD6D

To claim this, I am signing this object:

View React-stateless.jsx
// React stateless components examples
// Example based on egghead.io lesson 14
// https://egghead.io/lessons/react-building-stateless-function-components-new-in-react-0-14
// Stateless component definition as function
const UserList = ({users}) => (
<div>
{users.map(user => {
return <div>{user.name} - {user.type)</div>
})}
@vnglst
vnglst / destructuring.js
Last active Feb 15, 2016 — forked from mikaelbr/destructuring.js
Javascript examples
View destructuring.js
// === 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];
@vnglst
vnglst / Caddy.conf
Last active Feb 23, 2016
Caddy configuration files
View Caddy.conf
# Upstart service for Caddy
# Save in /etc/init/caddy.conf
description "Caddy Server"
author "Koen van Gilst"
start on filesystem or runlevel [2345]
stop on shutdown
#not working yet, try again on 25/2
View Unix directory structure
├── bin binaries with fundamental utilities like cp, ls etc
├── boot all files required for succesfull booting process
├── dev = "devices" and contains a file representation of all devices
├── etc system-wide configuration files
├── init contains upstart scripts
├── home home directories users
├── lib shared libraries for programs in /bin
├── lib64 see above, for 64 architecture
├── lost+found lost and potentially corrupt files
View Upstart Script Terminologica
# Upstart service for term.world node application
# Save in /etc/init/termworld.conf
description "Term.world node js application"
author "Koen van Gilst"
start on filesystem or runlevel [2345]
stop on shutdown or on runlevel [016]
setuid caddy
@vnglst
vnglst / Monitor website up
Last active Feb 23, 2016
Crontab script to monitor if website is still up
View Monitor website up
#!/bin/bash
if [[ `wget -q -O - https://terms.vangilst.eu/duits-nederlands/Biomonitoring | /usr/bin/grep "biologische monitoring"` == "" ]]; then /bin/echo "Website down" | /usr/bin/mail -s "terms.vangilst.eu down!" xxx@xxx.de; fi
@vnglst
vnglst / crontab
Last active Feb 23, 2016
Crontab file on Macbook for OverheidsEdits Twitter bot
View crontab
MAILTO=xxxx@xxxx.de
PATH=$PATH:/usr/local/bin/
*/5 * * * * /usr/local/bin/isTermUp.sh
@reboot /usr/local/bin/forever -c /usr/local/bin/coffee ~/node/overheid/anon.coffee >> ~/node/log/overheid.log
0 12 * * * /bin/cat ~/node/log/overheid.log | /usr/bin/mail -s "OverheidsEdits Tweets Report" xxx@xxx.de
View Scan for Apple device names
$ sudo apt-get install avahi-daemon
$ sudo apt-get install avahi-utils
$ avahi-browse --all --resolve
beter nog
$ avahi-browse --all --resolve -t”
dan stopt die wat eerder
@vnglst
vnglst / osx_pdf_join.sh
Created May 16, 2016 — forked from anthonywu/osx_pdf_join.sh
Mac OS X – bash function to join pdfs on the command line
View osx_pdf_join.sh
function pdf_join {
join_py="/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py"
read -p "Name of output file > " output_file && "$join_py" -o $output_file $@ && open $output_file
}