Skip to content

Instantly share code, notes, and snippets.

View diogeneshamilton's full-sized avatar

Matt Hamilton diogeneshamilton

View GitHub Profile
@cjweigle
cjweigle / Tabbar.jsx
Last active August 29, 2022 10:21
OnsenUI Tabbar Issue with React
import React from 'react';
import {Tabbar as _Tabbar} from 'react-onsenui';
class Tabbar extends React.Component{
constructor(props){
super(props);
this.render = this.render.bind(this);
this.componentWillReceiveProps = this.componentWillReceiveProps.bind(this);
this.updateIndex = this.updateIndex.bind(this);
@0x07dc
0x07dc / VenmoPaymentRequest
Last active August 29, 2015 14:02
A function to send a request for payment through Venmo, based on http://davidwalsh.name/curl-post and using the Venmo API
function sendPaymentRequest($email,$amount){
//http://davidwalsh.name/curl-post
//set POST variables
$url = 'https://api.venmo.com/v1/payments';
$access_token = ; // use your access token
$phone = $email; // This is email address, phone number, or user id (I think -- email addresses are common)
$note = "This is a request for a payment of $".$amount." for ...";
$amount = $amount;
$audience = 'private';// chose audience
@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active March 10, 2024 19:23
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
@s4y
s4y / async_test.cpp
Last active December 16, 2015 00:49
I'm working on a concurrency library inspired by Tame. I'm kinda loving it. Main difference: no code transformation.
#include <async.h>
void printLater(unsigned int seconds, const char message[]) {
asleep(seconds);
printf("%s\n", message);
}
void amain() {
printf("Before\n");
@afeld
afeld / gist:4952991
Last active February 8, 2022 03:13
good APIs for mashups

This list has been superseded by Public APIs. Check there for APIs with Auth: No, HTTPS and CORS Yes.


List of data APIs that require no server-side auth or private credentials, and are thus good for small browser-only JS projects.

@dcosson
dcosson / gist:3686437
Created September 9, 2012 18:52
Compile Vim on OSX (Mountain Lion)
# default vim on osx doesn't have python, ruby support or clipboard support. These configure options add all that
# I also ran into problems using rvm ruby, had to include those libs in the LDFLAGS for vim
# Steps:
$ rvm install 1.9.1
$ rvm use 1.9.1 # vim doesn't support anything higher
$ curl ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 | tar xj
$ cd vim73
$ ./configure --with-features=huge --enable-perlinterp=yes --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-multibyte
@bartkozal
bartkozal / vim.rb
Created August 22, 2012 09:04 — forked from uasi/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.618'
def features; %w(tiny small normal big huge) end
@leighmcculloch
leighmcculloch / NSString_stripHtml.h
Last active February 21, 2018 22:45
NSString + Strip HTML
// NSString_stripHtml.h
// Copyright 2011 Leigh McCulloch. Released under the MIT license.
#import <Foundation/Foundation.h>
@interface NSString (stripHtml)
- (NSString*)stripHtml;
@end