Skip to content

Instantly share code, notes, and snippets.

View mscharley's full-sized avatar

Matthew Scharley mscharley

View GitHub Profile
@mscharley
mscharley / app.js
Last active May 25, 2017 23:33 — forked from radiosilence/gist:4040553
RequireJS with Zurb Foundation 5
/*
This assumes that your bower_components folder is /assets. I renamed it in .bower.json for sanities sake.
I use baseUrl = '/js' as this is where all my custom javascript is and requirejs can't navigate
bower's folder structure anyway.
*/
requirejs.config({
paths: {

Keybase proof

I hereby claim:

  • I am mscharley on github.
  • I am mscharley (https://keybase.io/mscharley) on keybase.
  • I have a public key whose fingerprint is 9184 6FAE B9BC DC4A 692D 7813 EDF3 66C7 D424 7786

To claim this, I am signing this object:

@mscharley
mscharley / homestuck-keyboard.user.js
Last active April 9, 2022 11:18
Tampermonkey script - Adds keyboard shortcuts for easily navigating the Homestuck webcomic. May work for other MSPA comics.
// ==UserScript==
// @name Homestuck Keyboard Advancer
// @namespace http://matt.scharley.me/
// @version 1.13
// @updateURL https://gist.githubusercontent.com/mscharley/2d73c81d1d70c504d58d/raw/homestuck-keyboard.user.js
// @downloadURL https://gist.githubusercontent.com/mscharley/2d73c81d1d70c504d58d/raw/homestuck-keyboard.user.js
// @description Adds keyboard shortcuts for easily navigating the Homestuck webcomic. May work for other MSPA comics.
// @author Matthew Scharley
// @match *://www.homestuck.com/*
// @grant none
@mscharley
mscharley / skype.ps1
Created December 27, 2014 09:09
Open multiple Skype instances (Windows/Powershell)
$skypePath = (Get-ItemProperty -Path hkcu:\SOFTWARE\Skype\Phone).SkypePath
if (!(Test-Path $skypePath -pathType leaf)) {
Write-Host "Unable to find Skype for Desktop. Is it installed correctly?"
pause
exit 1
}
$dataPath = "$($env:localappdata)\SkypePortable"
$instanceCount = 2
@mscharley
mscharley / Dockerfile
Last active May 16, 2016 21:30 — forked from lussoluca/dockerfile
Dockerfile for logstash-input-acquia
FROM logstash:1.5
# RUN apt-get update && apt-get install -y \
# ruby \
# git \
# vim \
# zip \
# openssl \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
@mscharley
mscharley / circe.scala
Last active May 7, 2017 09:26
Decoding many, many fields with Circe.
import cats._
import cats.implicits._
import io.circe._
import io.circe.generic.semiauto._
implicit lazy val guildDecoder: Decoder[Guild] =
(c: HCursor) =>
implicitly[Monad[Either[DecodingFailure, ?]]] sequence Vector(
c.downField("id").as[Snowflake],
c.downField("name").as[String],
@mscharley
mscharley / compile-string.ts
Created November 11, 2017 04:20
Compile a string in TypeScript using imports and type-checking.
import * as ts from "typescript";
// tslint:disable
export const transpileModule = (input: string, transpileOptions: ts.TranspileOptions): ts.TranspileOutput => {
let diagnostics: ts.Diagnostic[] = [];
const options: ts.CompilerOptions = transpileOptions.compilerOptions || ts.getDefaultCompilerOptions();
options.isolatedModules = true;
@mscharley
mscharley / Session.re
Created November 2, 2018 23:58
Sample Session handler for bs-auth0-js
open Belt.Option;
open Js.Nullable;
open BsQuerystringify.QueryStringify;
open BsAuth0Js;
type accessToken = string;
type id = {
email: option(string),
name: option(string),
@mscharley
mscharley / Dockerfile.web
Last active February 16, 2021 22:05
Example Dockerfile for static compilation of ReasonML / OCaml projects using esy.
# vim: set filetype=dockerfile :
FROM node:10.13-alpine as build
ENV TERM=dumb \
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib
# Create a subuser so that NPM doesn't whine about running as root
RUN adduser -D -H -h /usr/src/app web && \
mkdir -p /usr/src/app && \
chown web:web /usr/src/app && \
@mscharley
mscharley / Generator.re
Last active January 19, 2022 02:45
Example of using JavaScript generators in ReasonML.
/* Note, this is only for library interop code. This is *not* a good way to do things in pure Reason code. */
module type GeneratorType {
type value('a);
type t('a);
type fn('a) = unit => t('a);
let valueGet: value('a) => option('a);
let doneGet: value('a) => bool;