Skip to content

Instantly share code, notes, and snippets.

View amnuts's full-sized avatar

Andrew Collington amnuts

View GitHub Profile
@guybrush
guybrush / gist:721762
Created November 30, 2010 14:38
nodejs file-sha1
#!/usr/bin/env node
require('fs').readFile('image.png',function(err, data){
console.log(require('crypto').createHash('sha1').update(data).digest('hex'))
})
@r-sal
r-sal / PHPExcel_Basics.md
Last active March 6, 2024 19:21
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@hofmannsven
hofmannsven / README.md
Last active April 19, 2024 13:17
Git CLI Cheatsheet
/**
* plugin.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
@MattWilcox
MattWilcox / build_nginx.sh
Last active March 6, 2022 18:01
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2d
export VERSION_NGINX=nginx-1.9.7
# URLs to the source directories
export SOURCE_OPENSSL=https://www.openssl.org/source/
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
@iamkirkbater
iamkirkbater / htla.js
Created April 7, 2015 17:35
Hamburger to Left Arrow Animation
(function() {
"use strict";
var toggles = document.querySelectorAll(".cmn-toggle-switch");
for (var i = toggles.length - 1; i >= 0; i--) {
var toggle = toggles[i];
toggleHandler(toggle);
};
@fdemiramon
fdemiramon / pre-commit
Created May 12, 2015 19:13
Pre-commit hook for git with phpcs and phpcbf (auto-correct obvious violations)
#!/bin/sh
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
oIFS=$IFS
IFS='
@protrolium
protrolium / ffmpeg.md
Last active April 8, 2024 11:49
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@iamkirkbater
iamkirkbater / _mixins.scss
Last active December 29, 2015 01:56
Mixins I commonly use.
@mixin font-smoothing($value: on) {
@if $value == on {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@else {
-webkit-font-smoothing: subpixel-antialiased;
-moz-osx-font-smoothing: auto;
}
}
@rowlandekemezie
rowlandekemezie / ajaxWithReduxSaga.js
Last active January 11, 2024 06:46
A basic implementation of AJAX with redux-saga
const { applyMiddleware, createStore } = Redux;
const createSagaMiddleware = ReduxSaga.default;
const { put, call } = ReduxSaga.effects;
const { takeLatest } = ReduxSaga;
const { connect, Provider } = ReactRedux;
// GitHub API
const gitHubApi = (username) => {
return fetch(`https://api.github.com/users/${username}`)
.then(response => {