Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Jonas nick-jonas

View GitHub Profile
@nick-jonas
nick-jonas / waves-css-anim.scss
Created Mar 27, 2014
Animating waves with CSS keyframes
View waves-css-anim.scss
@import "compass/css3/animation";
@import "compass/css3/transform";
$waveWidth:998px;
@include keyframes(waves){
0%{
left:0;
}
100%{
View voice-button-default.html
<voice-button cloud-speech-api-key="YOUR_API_KEY_HERE" autodetect></voice-button>
View voice-button-scalable.html
<voice-button mic-color="#230950" diameter="40"></voice-button>
<voice-button mic-color="#230950" diameter="160"></voice-button>
View voice-button-disabled.html
<voice-button mic-color="#416165" inverse></voice-button>
<voice-button mic-color="#416165" inverse disabled></voice-button>
View voice-button.html
<voice-button mic-color="#230950" inverse flat autodetect></voice-button>
@nick-jonas
nick-jonas / sync_rpi_time.sh
Created May 12, 2017
Place this snippet in your /etc/rc.local file so an RPI will sync time on boot
View sync_rpi_time.sh
#!/bin/sh
#force time set with NTP server
clear
echo Setting the time and date. Your sudo password may be required below...
echo
sudo ntpdate -bu pool.ntp.org
echo
echo The time and date are now set to `date`
echo
@nick-jonas
nick-jonas / bubbles-canvas.js
Last active Oct 24, 2016
Animating bubbles using Canvas
View bubbles-canvas.js
// called once, to initialize
createBubbles: function(){
var self = this,
el = this.element,
width = $(window).width(),
height = $(window).height(),
canvas = document.createElement('canvas');
el.style.width = canvas.width = width;
el.style.height = canvas.height = height;
@nick-jonas
nick-jonas / analyzespectrum.py
Created Aug 23, 2013
Analyze sound spectrum at 30 fps, from Mr. Doob's post: http://ricardocabello.com/blog/post/677
View analyzespectrum.py
import math
import struct
import wave
import sys
w = wave.open(sys.argv[1], 'rb')
# We assume 44.1k @ 16-bit, can test with getframerate() and getsampwidth().
sum = 0
value = 0;
delta = 0;
@nick-jonas
nick-jonas / gist:5531169
Created May 7, 2013
.bash_profile: tab completion for SSH hostnames on ~/.ssh/config
View gist:5531169
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
@nick-jonas
nick-jonas / ssh_easy_access.sh
Created Apr 29, 2013
Add ssh key to remote server for easy access (no typing in password). Just swap 'user' and 'server'
View ssh_easy_access.sh
cat ~/.ssh/id_rsa.pub | ssh user@server 'mkdir -p ~/.ssh; cat >> .ssh/authorized_keys'
You can’t perform that action at this time.