Skip to content

Instantly share code, notes, and snippets.

@nick-jonas
nick-jonas / bump-version.sh
Created August 17, 2022 13:09 — forked from Nomane/bump-version.sh
Bump version shell script.
#!/bin/bash
# Thanks goes to @pete-otaqui for the initial gist:
# https://gist.github.com/pete-otaqui/4188238
#
# Original version modified by Marek Suscak
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3" or even "1.2.3-beta+001.ab"
@nick-jonas
nick-jonas / waves-css-anim.scss
Created March 27, 2014 22:39
Animating waves with CSS keyframes
@import "compass/css3/animation";
@import "compass/css3/transform";
$waveWidth:998px;
@include keyframes(waves){
0%{
left:0;
}
100%{
@nick-jonas
nick-jonas / voice-button-default.html
Last active November 6, 2017 00:11
Voice Button
<voice-button cloud-speech-api-key="YOUR_API_KEY_HERE" autodetect></voice-button>
@nick-jonas
nick-jonas / voice-button-scalable.html
Created October 25, 2017 21:48
Voice Button scalable
<voice-button mic-color="#230950" diameter="40"></voice-button>
<voice-button mic-color="#230950" diameter="160"></voice-button>
<voice-button mic-color="#416165" inverse></voice-button>
<voice-button mic-color="#416165" inverse disabled></voice-button>
@nick-jonas
nick-jonas / voice-button.html
Last active October 25, 2017 21:08
Voice Button
<voice-button mic-color="#230950" inverse flat autodetect></voice-button>
@nick-jonas
nick-jonas / sync_rpi_time.sh
Created May 12, 2017 18:27
Place this snippet in your /etc/rc.local file so an RPI will sync time on boot
#!/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 October 24, 2016 02:55
Animating bubbles using Canvas
// 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 August 23, 2013 17:16
Analyze sound spectrum at 30 fps, from Mr. Doob's post: http://ricardocabello.com/blog/post/677
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 08:42
.bash_profile: tab completion for SSH hostnames on ~/.ssh/config
# 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