Skip to content

Instantly share code, notes, and snippets.

View masonkmeyer's full-sized avatar

Mason Meyer masonkmeyer

  • Salt Lake City, UT
View GitHub Profile
@miguelmota
miguelmota / auth.go
Created February 11, 2019 21:26
Golang AWS Cognito Validate JWT token
package auth
import (
"crypto/rsa"
"encoding/base64"
"encoding/binary"
"encoding/json"
"fmt"
"io/ioutil"
"log"
@nathankerr
nathankerr / Info.plist
Last active July 25, 2025 12:08
Registering a Go app as a protocol handler under Mac OS X
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>myapp</string>
<key>CFBundleIdentifier</key>
<string>com.pocketgophers.myapp</string>
<key>CFBundleURLTypes</key>
<array>
@masonkmeyer
masonkmeyer / cp.ts
Last active August 16, 2017 12:53
cp with RxJS and TS
import * as rx from 'rxjs';
import * as fs from 'fs';
import * as path from 'path';
function cp(from: string, to: string) {
return stat(from)
.flatMap((s) => {
return s.isDirectory() ? copyDir(from, to) : copyFile(from, to)
})
}
@staltz
staltz / introrx.md
Last active August 15, 2025 20:30
The introduction to Reactive Programming you've been missing
using System;
using System.Linq;
using Ninject;
using Ninject.Extensions.Factory;
namespace SomeRootNamespace
{
class Program
{
static void Main(string[] args)
@domenic
domenic / di-in-requirejs.js
Created October 10, 2011 04:05
Dependency injection sample with RequireJS
// EntryPoint.js
define(function () {
return function EntryPoint(model1, model2) {
// stuff
};
});
// Model1.js
define(function () {
return function Model1() {
@jcsrb
jcsrb / gist:1081548
Created July 13, 2011 23:05
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version