Skip to content

Instantly share code, notes, and snippets.

View tlongren's full-sized avatar
🎯
Focusing

Tyler Longren tlongren

🎯
Focusing
View GitHub Profile
@zmh
zmh / bowery-php-mysql.md
Last active August 29, 2015 14:02
Using Bowery with PHP and MySQL

Using Bowery with PHP and MySQL

Bowery works well with PHP and MySQL, but there are a few steps you have to take before you can get started.

##Short version

  1. Run bowery pull 5397a3faabd3328a13000006 in an empty directory
  2. Run bowery connect and then disconnect with CTRL+C once you see the message "Service php upload complete. Syncing file changes."
  3. Run bowery ssh php, service apache2 restart, and then exit. Disregard any terminal output or warnings that are printed.
  4. Run bowery ssh mysql, mysql --user=root --password=your_password < /application/example.sql, and then exit. Disregard any terminal output or warnings that are printed.
  5. Run bowery connect and then open the last URL that is printed.
@n7studios
n7studios / soliloquy-reload-page-on-navigation-click.php
Created April 20, 2015 14:30
Soliloquy - Reload Page on Navigation Click
<?php
/**
* Plugin Name: Soliloquy - Reload Page on Navigation Click
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Tim Carr
* Author URI: http://www.n7studios.co.uk
* Description: Reloads the entire Page when the next or previous arrows are clicked, or the pager navigation is used. The correct slide is injected into the URL.
*/
@siddarth
siddarth / gist:1379771
Created November 20, 2011 03:32
Stripe PHP simple example with amount
<?php
require 'path-to-Stripe.php';
if ($_POST) {
Stripe::setApiKey("STRIPE_API_KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");
@jkuemerle
jkuemerle / payment.php
Created October 15, 2012 04:04
Payment Processing Top
<?php
require_once("Stripe.php");
Stripe::setApiKey('<secret key>');
$name = htmlspecialchars($_POST["name"]);
$address1 = htmlspecialchars($_POST["address1"]);
$city = htmlspecialchars($_POST["city"]);
$state = htmlspecialchars($_POST["state"]);
$zip = htmlspecialchars($_POST["zip"]);
$email = htmlspecialchars($_POST["email"]);
@claudiodangelis
claudiodangelis / fixNavbarIssue.js
Created November 8, 2012 21:08
[bootstrap] fixing issue #4153 `navbar-fixed-top`
function fixNavbarIssue(){
/* Quick & dirt draft fix for the bootstrap's navbar-fixed-top issue.
Overview
When you call a given section of a document (e.g. via <a href="#section"> or domain.com/page#section1) browsers show that section at the top of window. Bootstrap's navbar-fixed-top, _since it's fixed_, *overlays* first lines of content.
This function catches all of the <a> tags pointing to a section of the page and rewrites them to properly display content.
Works fine even if a # section is called from URL.
Usage
@ivos
ivos / fixNavbarIssue.js
Created November 11, 2012 18:31 — forked from claudiodangelis/fixNavbarIssue.js
[bootstrap] fixing issue #4153 `navbar-fixed-top`
function fixNavbarIssue(){
/* Quick & dirt draft fix for the bootstrap's navbar-fixed-top issue.
Overview
When you call a given section of a document (e.g. via <a href="#section"> or domain.com/page#section1) browsers show that section at the top of window. Bootstrap's navbar-fixed-top, _since it's fixed_, *overlays* first lines of content.
This function catches all of the <a> tags pointing to a section of the page and rewrites them to properly display content.
Works fine even if a # section is called from URL.
Usage
@boukeversteegh
boukeversteegh / BADPS.md
Last active November 7, 2015 16:53
[DRAFT] Bitcoin Address Discovery Protocol over SMS

Bitcoin Address Discovery Protocol over SMS


Title:   Bitcoin Address Discovery Protocol over SMS
Author:  Bouke Versteegh <info@boukeversteegh.nl>
Status:  Draft
Created: 2014-03-14
<?php
require __DIR__ . '/lib/Stripe.php';
if ($_POST) {
Stripe::setApiKey("sk_test_OXXXXXXXXXXXXXXXXXXX9");
try {
// Use Stripe's bindings...
} catch(Stripe_CardError $e) {
// Since it's a decline, Stripe_CardError will be caught
$body = $e->getJsonBody();
@luk3thomas
luk3thomas / form.html
Created February 16, 2013 02:31
form.html is the payment form. main.js is the javascript to intercept the payment form and encode the credit card. payment.php charges the card and sends out any emails.
<table class="team sponsor">
<thead>
<tr>
</tr>
</thead>
<tr>
<td>Business Name</td>
<td><input class="name" type="text" value="" name="s_name" /></td>
</tr>
<tr>
@tlongren
tlongren / flush-iptables.sh
Last active December 18, 2015 00:49
iptables firewall for VPS on Debian Squeeze
#!/bin/sh
# This file will reset the firewall to allow everything.
#
# Set the default policy
#
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
#