Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
@xiaohanyu
xiaohanyu / yaml_to_json.rb
Created September 1, 2014 06:29
convert yaml to json in ruby
require 'json'
require 'yaml'
input_filename = ARGV[0]
output_filename = input_filename.sub(/(yml|yaml)$/, 'json')
input_file = File.open(input_filename, 'r')
input_yml = input_file.read
input_file.close
@magnetikonline
magnetikonline / README.md
Last active February 18, 2025 08:11
Setting Nginx FastCGI response buffer sizes.
@navitronic
navitronic / db-backup.sh
Last active September 15, 2017 23:45
A short bash script that exports all databases into separate gzipped files in a chosen location.
#!/bin/bash
# Example usage
# --
#
# ./db-backup.sh -u username -p password -t /target/
while getopts u:p:t: option
do
case "${option}"
@yakovkhalinsky
yakovkhalinsky / styles.less
Last active April 12, 2022 14:31
My Atom editor personal stylesheet
// colour vars (or color if you're American)
@plain-black: #000;
@plain-white: #fff;
@funky-green: #00ff00; // original
.title-bar {
padding: 15px;
letter-spacing: 0.08em;
font-size: 1.1em;
}
@vedant
vedant / gist:9333992
Last active September 26, 2024 01:23
Export note files from Google Keep
/* Vedant Misra (vedantmisra.com) (github.com/vedant)
*
* Script for exporting Google Keep note files.
*
* This does not handle attachments or checklists, only note files. Downloads
* each note to a .txt file named for the note's title.
*
* To use this, go to https://drive.google.com/keep/ and wait for the page to
* fully load all of your saved notes; scroll to the bottom to confirm they're
* loaded. Then paste the below in your URI bar, go to the start of the line,
@alairock
alairock / styles.less
Last active October 3, 2019 15:49
Atom.io custom styling.
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@jewlofthelotus
jewlofthelotus / CustomSlickQuizFilters.phtml
Last active August 23, 2016 10:22
An example WordPress plugin that hooks into the SlickQuiz WordPress plugin. Thanks to @phh for his contribution and example from which this is modified. https://github.com/jewlofthelotus/SlickQuiz-WordPress/pull/37
class CustomSlickQuizFilters {
function __construct()
{
add_filter( 'slickquiz_admin_options', array( &$this, 'custom_admin_options' ) );
add_filter( 'slickquiz_after_options', array( &$this, 'custom_after_options' ) );
add_filter( 'slickquiz_after_result', array( &$this, 'custom_after_result' ) );
}
function custom_admin_options( $options )
@samwize
samwize / mocha-guide-to-testing.js
Created February 8, 2014 05:53
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()