Skip to content

Instantly share code, notes, and snippets.

View vnglst's full-sized avatar
💭
Building 🪲

Koen van Gilst vnglst

💭
Building 🪲
View GitHub Profile

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:

@vnglst
vnglst / React-stateless.jsx
Last active February 15, 2016 10:38
React examples
// 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 February 15, 2016 10:38 — forked from mikaelbr/destructuring.js
Javascript examples
// === 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 February 1, 2024 05:00
Caddy configuration files
# 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
@vnglst
vnglst / Unix directory structure
Last active February 15, 2016 11:02
Unix general
├── 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
# 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 February 23, 2016 14:21
Crontab script to monitor if website is still 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 February 23, 2016 15:04
Crontab file on Macbook for OverheidsEdits Twitter bot
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
$ 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 15:16 — forked from anthonywu/osx_pdf_join.sh
Mac OS X – bash function to join pdfs on the command line
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
}