Skip to content

Instantly share code, notes, and snippets.

Avatar

Tyler Longren tlongren

View GitHub Profile
@zmh
zmh / bowery-php-mysql.md
Last active Aug 29, 2015
Using Bowery with PHP and MySQL
View bowery-php-mysql.md

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 Apr 20, 2015
Soliloquy - Reload Page on Navigation Click
View soliloquy-reload-page-on-navigation-click.php
<?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 Nov 20, 2011
Stripe PHP simple example with amount
View gist:1379771
<?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 Oct 15, 2012
Payment Processing Top
View payment.php
<?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 Nov 8, 2012
[bootstrap] fixing issue #4153 `navbar-fixed-top`
View fixNavbarIssue.js
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 Nov 11, 2012 — forked from claudiodangelis/fixNavbarIssue.js
[bootstrap] fixing issue #4153 `navbar-fixed-top`
View fixNavbarIssue.js
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 Nov 7, 2015
[DRAFT] Bitcoin Address Discovery Protocol over SMS
View BADPS.md

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
View stripe_updated.php
<?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 Feb 16, 2013
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.
View form.html
<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 Dec 18, 2015
iptables firewall for VPS on Debian Squeeze
View flush-iptables.sh
#!/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
#