Skip to content

Instantly share code, notes, and snippets.

@fmpwizard
fmpwizard / time-lapse.sh
Created November 12, 2013 01:30
Take pictures on the Raspberry Pi once a second and store them on a uuid named folder This runs at boot time using @reboot on cron
#!/bin/bash
let X=1;
folder=`/usr/bin/dbus-uuidgen`
cd /home/pi/camera/trip
mkdir $folder
cd $folder
while true; do
raspistill -rot 90 -w 1024 -h 768 -o $X.jpg
sync
echo "Image: $X.jpg";
@iand
iand / gist:8581346
Last active January 4, 2016 06:19
Reasons why Go works for me

Some notes on why Go works for me and why it might work for you if you're looking for another language to add to your repetoire. Goes without saying that this reflects my personal taste.

Go features that I particularly like

  • Multicore is the future so I like that Go has concurrency built right into the core. Goroutines and channels provide a very accessible metaphor for thinking about concurrent programming. They're supported by language features that really make Go shine in this area. The select statement, for example, makes it easy to listen to and synchronise events from different concurrent threads.
  • Provides both pointers and value types, but the pointers are safe and managed. Automatic memory management means its safe to return a pointer to a local variable.
  • Interfaces in Go are smooth and unobtrusive. They automatically apply to anything with the right function signature so you can define interfaces that are satisfied by 3rd party code without you having to change it.
  • Errors are signale
@ismasan
ismasan / sse.go
Last active February 27, 2025 00:15
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
@degan
degan / gist:70e8059507d173751294
Last active August 29, 2015 14:16
FREAK Attack server test
see discussion below