Skip to content

Instantly share code, notes, and snippets.

View mbritton's full-sized avatar
🏠
Working from home

Mike Britton mbritton

🏠
Working from home
View GitHub Profile
@lwcooper
lwcooper / gist:246a46902e5bc11c151c84f0f69a3612
Created October 31, 2017 00:05
Get content from Prismic.io for static site generator
// You can run this script as part of your build step in your package.json
// eg:
// ...
// "scripts": {
// "build": "node get-content.js && hugo"
// }
// ...
var fs = require('fs'); //to access filewrite
var toMarkdown = require ('to-markdown'); //to convert HTML to Markdown
@jackgill
jackgill / bundle.js
Last active March 25, 2024 13:53
A node.js script to create a bundle containing an npm package, and all of its dependencies.
/*
* This script will download a package (and all of its dependencies) from the
* online NPM registry, then create a gzip'd tarball containing that package
* and all of its dependencies. This archive can then be copied to a machine
* without internet access and installed using npm.
*
* The idea is pretty simple:
* - npm install [package]
* - rewrite [package]/package.json to copy dependencies to bundleDependencies
* - npm pack [package]
@carlosefonseca
carlosefonseca / GPXWriter.java
Created August 2, 2013 20:26
Writes a list of timed coordinates to a GPX file.
package pt.beware.core;
import android.location.Location;
import pt.beware.common.utils.Log;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@ralphcrisostomo
ralphcrisostomo / httpd.conf
Last active November 20, 2022 08:12
Create an alias directory in XAMPP
# Create an alias directory in XAMPP
# Ref: http://www.mauriciomunera.com/?p=127
# Ref: https://gist.github.com/ralphcrisostomo/4974674/
# Open the file /Applications/xampp/etc/httpd.conf in a text editor.
# Add these lines to the end of the files. (change the name of the alias for the web application that suits better for you)
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
@fjfish
fjfish / SearchableAdapter.java
Created June 30, 2012 15:48
Simple String Adapter for Android ListView that has a filter that gives whatever it finds and ignores word boundaries
package com.yourco.yourapp;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
@petersendidit
petersendidit / lineargradienttest.js
Created February 2, 2011 13:43
Modernizr test for linear-gradient() support
/*
Modernizr already has a test for cssgradients but it checks the old webkit syntax
In order to do px points we need linear-gradient()
Webkit did not have suport for linear-gradient() until Jan 2011
http://webkit.org/blog/1424/css3-gradients/
So here is a test to check for it.
*/
Modernizr.addTest('lineargradient', function () {
var test = document.createElement('div'),