Skip to content

Instantly share code, notes, and snippets.

View stevewaffles's full-sized avatar

stevewaffles

View GitHub Profile
@stevewaffles
stevewaffles / index.php
Last active August 29, 2015 13:58
Stripe test app
<?php
require_once('./stripe-php/lib/Stripe.php');
$stripe = array(
"secret_key" => "YOUR_SECRET_KEY",
"publishable_key" => "YOUR_PUBLIC_KEY"
);
Stripe::setApiKey($stripe['secret_key']);
?>
@stevewaffles
stevewaffles / charge.php
Created April 13, 2014 20:14
Stripe test app
<pre>
<?php
print_r($_POST);
?>
</pre>
<p>
<a href="/">Start over</a>
</p>
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast)
(function poll(){
$.ajax({ url: "server", success: function(data){
//Update your dashboard gauge
salesGauge.setValue(data.value);
}, dataType: "json", complete: poll, timeout: 30000 });
})();
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
UIRectFill(CGRectInfinite);
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@stevewaffles
stevewaffles / filepicker_acclaim.js
Created December 2, 2014 22:40
FilePicker upload to Acclaim
filepicker.setKey('Ar6ip0fB0RbyQ2LuJnyB4z');
filepicker.pickAndStore({services:['computer']}, {location:"S3"}, function(response) {
upload_finished(response);
});
function upload_finished(response) {
$.ajax({
url: '/media/add/780',
type: "POST",
var Video = Backbone.Model.extend({});
var VideoList = Backbone.Collection.extend({
model: Video,
url: '/videos'
});
var VideoPlayerView = Backbone.View.extend({
id: 'video-player',
className: 'video-player',
@stevewaffles
stevewaffles / MakeOpenVPN.sh
Last active August 29, 2015 14:26 — forked from laurenorsini/MakeOpenVPN.sh
MakeOpenVPN.sh by Eric Jodoin
#!/bin/bash
# Default Variable Declarations
DEFAULT="Default.txt"
FILEEXT=".ovpn"
CRT=".crt"
KEY=".3des.key"
CA="ca.crt"
TA="ta.key"
local 192.168.1.2 # SWAP THIS NUMBER WITH YOUR RASPBERRY PI IP ADDRESS
dev tun
proto tcp #Some people prefer to use tcp. Don't change it if you don't know.
port 443
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/ttg.crt # SWAP WITH YOUR CRT NAME
key /etc/openvpn/easy-rsa/keys/ttg.key # SWAP WITH YOUR KEY NAME
dh /etc/openvpn/easy-rsa/keys/dh1024.pem # If you changed to 2048, change that here!
server 10.8.0.0 255.255.255.0
# server and remote endpoints
client
dev tun
proto tcp
remote 1.tcp.ngrok.io 20352
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ns-cert-type server