Skip to content

Instantly share code, notes, and snippets.

View sajclarke's full-sized avatar

Shannon Clarke sajclarke

View GitHub Profile
@miguelfrmn
miguelfrmn / simpleimage.php
Last active May 9, 2023 11:23
SimpleImage PHP Class
<?php
/**
* File: SimpleImage.php
* Author: Simon Jarvis
* Modified by: Miguel Fermín
* Based in: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@afreeland
afreeland / gist:8184438
Last active November 11, 2021 11:45
JavaScript: CSV Get Headers from input stream using ArrayBuffer
function CSVImportGetHeaders()
{
// Get our CSV file from upload
var file = document.getElementById('CSVUpload').files[0]
// Instantiate a new FileReader
var reader = new FileReader();
// Read our file to an ArrayBuffer
reader.readAsArrayBuffer(file);
@shime
shime / _readme.md
Last active April 28, 2023 18:56
github oauth in node using express

What?

Most basic example of authenticating with Github in node.

How?

Clone this gist, change keys inside config.js and then hit npm install && node app.js.

Done?

@sean-hill
sean-hill / Ionic and ngCordova upload example
Last active May 6, 2019 01:52
Upload service for Ionic and ngCordova
Ionic and ngCordova upload example
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 18, 2025 06:21
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

// This is a dead-simple script that simply logs the usernames of the people who have updated a post, ordered by when they voted
var access_token = "YOUR_TOKEN";
var post_id = "POST_ID";
var theUrl = "https://api.producthunt.com/v1/posts/"+post_id+"/votes?access_token=" + access_token
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send( null );
votes = JSON.parse(xmlHttp.responseText).votes;
@jasonals
jasonals / bus-routes.json
Created October 25, 2015 18:48
Barbados's public transportation
[
{
"busId": "1",
"routeId": "",
"name": "Princess Alice Terminal to Speightstown Terminal",
"num": "1",
"stops": []
},
{
"busId": "2",
.PHONY: run
# certs and output
OUTPUT_FILE=apkname.apk
ALIAS=youralias
KEYPASS=yourkeypass
KEYSTORE=certs/yourcert.keystore
UNSIGNED=platforms/android/build/outputs/apk/android-release-unsigned.apk
# or, if you're using Crosswalk:
@siakaramalegos
siakaramalegos / basic_router.jsx
Last active July 6, 2023 04:02
Basic example of React Router: BrowserRouter, Link, Route, and Switch
// BrowserRouter is the router implementation for HTML5 browsers (vs Native).
// Link is your replacement for anchor tags.
// Route is the conditionally shown component based on matching a path to a URL.
// Switch returns only the first matching route rather than all matching routes.
import {
BrowserRouter as Router,
Link,
Route,
Switch,
} from 'react-router-dom';
@madcoda
madcoda / App.js
Created May 28, 2017 04:24
React-router v4 multi layout
import React, { Component } from 'react'
import { BrowserRouter as Router, Route, Link, Match, Redirect, Switch } from 'react-router-dom'
import OverviewPage from './page/OverviewPage'
import AccountPage from './page/AccountPage'
/*
Layouts, inline define here for demo purpose
you may want to define in another file instead
*/