Skip to content

Instantly share code, notes, and snippets.

View maml's full-sized avatar
💭
build

Matthew Loseke maml

💭
build
  • Laurentide Ice Sheet
View GitHub Profile
@maml
maml / scapple-cheatsheet.md
Last active February 9, 2023 05:22
scapple shortcuts & cheatsheet

Scapple shortcuts & cheatsheet

Notes

Create a new note by current cursor position:

double click
@maml
maml / keybase.md
Last active December 13, 2018 15:44

Keybase proof

I hereby claim:

  • I am maml on github.
  • I am maml (https://keybase.io/maml) on keybase.
  • I have a public key ASDIp5EzI7lBW5qXThKT6_uoFUajwI6e7eNCvJzP3ZrBkgo

To claim this, I am signing this object:

@maml
maml / jest.mock.rn-firebase.js
Created November 1, 2018 21:26
react-native-firebase jest mock
jest.mock('react-native-firebase', () => {
return {
admob: jest.fn(() => {
return {
onNotification: jest.fn(),
onNotificationDisplayed: jest.fn()
}
}),
analytics: jest.fn(() => {
return {
@maml
maml / dump_and_upload.sh
Created February 20, 2017 02:39
rails, dump db & upload to heroku
# dump your db, note: the heroku command failed for me without the --format=c flag being set.
pg_dump --no-acl --no-owner --format=c database_name > db.dump
# in my case I have a remote, staging, I want to upload to
heroku pg:backups restore 'url_for_db.dump' DATABASE_URL -r staging
@maml
maml / integer-suffixes.swift
Created March 5, 2016 00:42
For a given Int you can get the appropriate suffx
extension Int {
public func suffix() -> String {
let absSelf = abs(self)
switch (absSelf % 100) {
case 11...13:
return "th"
default:
@maml
maml / UIButton.swift
Created September 8, 2015 18:11
Adds some helper methods to UIButton for enabling, disabling, hiding, showing, and combinations thereof.
import UIKit
extension UIButton {
func disable() {
self.enabled = false
}
func enable() {
# api docs say to submit . . .
{
'user_invitation_token' : 'xyz###',
'first_name' : 'John',
'last_name' : 'Appleseed',
'email' : '[email protected]',
'username' : 'john',
'password' : 'foobar',
'password_confirmation' : 'foobar'
}
var currentDate = new Date();
futureDate = new Date("March 17, 2015 21:00:00"); // page says launching from March 9th
var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000;
jQuery('#basketballCountdownClock').FlipClock(diff, {
clockFace: 'DailyCounter',
countdown: true
});
@maml
maml / gist:1e30d1b821635fb69ab3
Created October 5, 2014 19:13
script tag for tincanapp.com
<script type="text/javascript" src="https://raw.github.com/edits-by-us/client/master/edits-by-us.min.js" id="js-edu-script-tag" data-selectors="#article-body" data-token="12c687b0-2ef1-0132-e700-20c9d07cae7b"></script>
+ (void)blurbWasLiked:(PFObject *)blurb byUser:(PFUser *)liker
{
/*
Query for blurb's user
*/
PFQuery *userQuery=[PFUser query];
PFUser *blurbUser = [blurb objectForKey:@"user"];
[userQuery whereKey:@"objectId" equalTo:blurbUser.objectId];
/*