Skip to content

Instantly share code, notes, and snippets.

John Noel johnnoel

View GitHub Profile
@johnnoel
johnnoel / ginit.vim
Created Apr 21, 2018
Provisional nvim initi files
View ginit.vim
" see https://github.com/powerline/fonts/tree/master/DejaVuSansMono
GuiFont! Droid Sans Mono Dotted for Powe:h10
call GuiWindowMaximized(1)
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
@johnnoel
johnnoel / Average.js
Created Feb 18, 2017
JavaScript ES6 Classes for perceptual image hashing
View Average.js
import Colour from './Colour';
import Resample from './Resample';
/**
* Average hash for images
*
* @author John Noel <john.noel@chaostangent.com>
* @see http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
* @see https://github.com/jenssegers/imagehash/blob/master/src/Implementations/AverageHash.php
*/
@johnnoel
johnnoel / output.html.twig
Created Jan 17, 2017
Twig template for Swagger API documentation
View output.html.twig
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<title>Swagger documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,700,900">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>{{ info.title }}{% if info.version is defined and info.version is not empty %} <small>v{{ info.version }}</small>{% endif %}</h1>
View keybase.md

Keybase proof

I hereby claim:

  • I am johnnoel on github.
  • I am chaostangent (https://keybase.io/chaostangent) on keybase.
  • I have a public key whose fingerprint is B123 5F99 E19D EA12 5899 32CD F97E 8DCE 6396 6994

To claim this, I am signing this object:

@johnnoel
johnnoel / archive.php
Created May 2, 2015
chaostangent.com archiver
View archive.php
<?php
use Buzz\Browser,
Buzz\Client\Curl;
require __DIR__.'/vendor/autoload.php';
$rootDir = __DIR__.'/archive';
$baseUrl = 'https://chaostangent.com/';
$postsPerPage = 5;
@johnnoel
johnnoel / barcoder.php
Last active Aug 29, 2015
Creates "barcode" style images from video files, kind of like http://moviebarcode.tumblr.com/
View barcoder.php
<?php
$videoFiles = array();
if ($_SERVER['argc'] <= 1) {
die('No files passed in command line');
}
array_shift($_SERVER['argv']);
$videoFiles = $_SERVER['argv'];
@johnnoel
johnnoel / screenshotter.php
Created Oct 11, 2012
PHP script for controlling mplayer to automatically take screenshots
View screenshotter.php
<?php
define('DS', DIRECTORY_SEPARATOR);
$ssCount = 250;
$cmdMplayer = "e:\downloads\mplayer\mplayer\mplayer.exe";
$argsInfo = " -vo null -nosound -frames 0 -identify";
$argsCapture = " -quiet -nosound -vo jpeg:quality=90 -vf framestep=i{framestep} -fps 360 -lavdopts threads=4";
if($_SERVER['argc'] > 1)
{
@johnnoel
johnnoel / delocal.js
Created Jan 21, 2012
PhantomJS input for rendering a page with webfonts (not yet Typekit compatible)
View delocal.js
var stylesheets = document.styleSheets;
for (i in stylesheets) {
var stylesheet = stylesheets[i];
var rules = stylesheet.cssRules;
for (j in rules) {
var rule = rules[j];
if (rule instanceof CSSFontFaceRule) {
var src = rule.style.getPropertyValue('src');
var srcSansLocal = src.replace(/local\([^\)]+?\)\s*,\s*/i, '');
rule.style.setProperty('src', srcSansLocal, null);
You can’t perform that action at this time.