Skip to content

Instantly share code, notes, and snippets.

$('.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 January 24, 2018 12:13
Run this to fix the character & emoji palette in OSX high sierra.
#!/bin/bash
sudo rm /System/Library/Caches/com.apple.IntlDataCache*;
sudo rm /var/folders/*/*/*/com.apple.IntlDataCache*;
@nosajio
nosajio / video-to-gif.md
Created October 14, 2017 15:17
How to make a gif animation from a video file with FFMPEG

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

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 September 26, 2016 14:41
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.
(function() {
'use strict';
/**
* Radial Coordinates animation
* For use with <path d="{coords}">
*
*
* Example
*
@nosajio
nosajio / Unless.js
Last active April 29, 2016 14:59
A useful little unless function written in javascript.
/**!
* Unless
* @created April 2013 by @jasonhowmans
*/
var unless = function( condition, callback ) {
if (typeof callback === 'function') {
if (!condition) callback();
}else{
return !condition;
}
@nosajio
nosajio / _ms.scss
Created April 29, 2016 14:49
Modular scale stepper function, for moving up and down a modular scale.
/**!
* 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;
// ==================================================
// 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() {
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 November 19, 2015 12:08
List number of commits by user in all projects
for i in `find . -type d -maxdepth 1`; do
echo $i;
cd $i;
git log --oneline --all --author="\(jason\)" | wc -l;
cd ~/Code;
done