Skip to content

Instantly share code, notes, and snippets.

Avatar
🏃‍♂️
Not sleeping

Jason Howmans nosajio

🏃‍♂️
Not sleeping
View GitHub Profile
View animate-css-hover.js
$('.animated-hover').each(function(i) {
$(this).on('mouseover', function() {
$(this).addClass('animated');
})
.on('mouseout', function() {
$(this).removeClass('animated');
});
});
@nosajio
nosajio / fix-character-palette.sh
Created Jan 24, 2018
Run this to fix the character & emoji palette in OSX high sierra.
View fix-character-palette.sh
#!/bin/bash
sudo rm /System/Library/Caches/com.apple.IntlDataCache*;
sudo rm /var/folders/*/*/*/com.apple.IntlDataCache*;
@nosajio
nosajio / video-to-gif.md
Created Oct 14, 2017
How to make a gif animation from a video file with FFMPEG
View video-to-gif.md

First, save the input video as individual frames at 10 FPS:
ffmpeg -i input.mp4 -vf scale=500:-1:flags=lanczos,fps=10 frames/ffout%03d.png

Next, join the frames up again to make the gif:
ffmpeg -i ./frames/ffout%03d.png output.gif

Bonus to optimise the gif with gifsicle:
gifsicle -O3 output.gif -o output-optimized.gif

View keybase.md

Keybase proof

I hereby claim:

  • I am nosajio on github.
  • I am nosaj (https://keybase.io/nosaj) on keybase.
  • I have a public key whose fingerprint is B2F7 BF62 9A76 E734 4FE9 8AB7 9450 AC6D 906F 6AD2

To claim this, I am signing this object:

@nosajio
nosajio / pathAnimateCircle.js
Created Sep 26, 2016
This little guy will output coordinates for animating svg <path>s into a percentage of a circle. Useful for pie charts and that kind of thing.
View pathAnimateCircle.js
(function() {
'use strict';
/**
* Radial Coordinates animation
* For use with <path d="{coords}">
*
*
* Example
*
@nosajio
nosajio / _ms.scss
Created Apr 29, 2016
Modular scale stepper function, for moving up and down a modular scale.
View _ms.scss
/**!
* SCSS Modular scale function
* Will use $ms-base as the scale, and $degrees to calculate stops on the scale
*
* @author Jason Howmans <@jhwmns>
*
* @examples
* Usage example for font size:
* // Using a scale of 1.4, this will output font-size: 1.96rem;
* font-size: #{ms(2)}rem;
View transform-disqus.py
import csv
sourcefile = './src/origin.csv'
destinationfile = './dist/https-comments.csv'
data = []
print('Opening write file %r' % destinationfile)
with open(destinationfile, 'w') as writeFile:
writer = csv.writer(writeFile, delimiter=',')
print('Opening read file %r' % sourcefile)
with open(sourcefile, newline='') as csvfile:
disqussrc = csv.reader(csvfile, delimiter=' ', quotechar='|')
@nosajio
nosajio / list-commits.sh
Created Nov 19, 2015
List number of commits by user in all projects
View list-commits.sh
for i in `find . -type d -maxdepth 1`; do
echo $i;
cd $i;
git log --oneline --all --author="\(jason\)" | wc -l;
cd ~/Code;
done
View breaker.js
// ==================================================
// Active media query listener / breakpoint manager
// @depends: Modernizr
// ==================================================
var breaker = function( breakpoints ) {
var exec = []
, self = this;
if (typeof breakpoints !== 'object') return false;
self.test = function() {
@nosajio
nosajio / Unless.js
Last active Apr 29, 2016
A useful little unless function written in javascript.
View Unless.js
/**!
* Unless
* @created April 2013 by @jasonhowmans
*/
var unless = function( condition, callback ) {
if (typeof callback === 'function') {
if (!condition) callback();
}else{
return !condition;
}