Skip to content

Instantly share code, notes, and snippets.

@projectxcappe
projectxcappe / fromfolder.php
Created September 15, 2011 23:22
Display Images From A Folder with PHP
//Display Images From A Folder with PHP
<?php
$files = glob("images/*.*");
for ($i=1; $i<count($files); $i++)
{
$num = $files[$i];
echo '<img src="'.$num.'" alt="random image">'."&nbsp;&nbsp;";
}
?>
@projectxcappe
projectxcappe / sudoku2cnf.cpp
Created September 6, 2011 16:49
Sudoku to cnf solver
//Cass Pangell
//9.23.2008
//sudoku2cnf rewrite
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
using namespace std;
{
"interval_data": {
"Ascending": [
{
"root":"A2",
"m2": "Bb2",
"M2": "B2",
"m3": "C3",
POST /api/register
Register a user or login an existing user. Send along `email` and `password`. A new user won't be created if a user already has that email. You'll get back an `api_token` to use for requests that need authorization.
POST /api/stripe_token
For Stripe SDK to get the token it needs to approve a charge. Send along `stripe_version` and get back the JSON for the key or an error.
GET /api/venues
@projectxcappe
projectxcappe / API_Doc.swift
Last active June 28, 2018 16:52
API_Doc.swift
//Login
Login {
let email: String
let fb_id: String //when fb is implemented
let password: String
let password_reset_code: String
let phone_number: String
let user_id: String
}
URL_STRING = "https://lineopener2.herokuapp.com/api"
///////////////SignUp///////////////
ENDPOINT: "URL_STRING/register"
REQUEST:
signupRequest(email:String, password:String)
let stripe_version = STPSDKVersion
request.httpMethod = "POST"
request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
struct Venue: Codable, Equatable {
static func ==(lhs: Venue, rhs: Venue) -> Bool {
return
lhs.longitude == rhs.longitude &&
lhs.latitude == rhs.latitude &&
lhs.id == rhs.id &&
lhs.tax_rate == rhs.tax_rate &&
lhs.name == rhs.name &&
struct Venue: Codable, Equatable {
static func ==(lhs: Venue, rhs: Venue) -> Bool {
return
lhs.longitude == rhs.longitude &&
lhs.latitude == rhs.latitude &&
lhs.venue_id == rhs.venue_id &&
lhs.venue_tax_rate == rhs.venue_tax_rate &&
lhs.name == rhs.name &&
struct PlacesData: Codable {
let data: [Place]
// let msg: String
// let status: Int
// let statuscode: Int
}
struct Place: Codable, Equatable {
static func ==(lhs: Place, rhs: Place) -> Bool {
return
struct PlacesData: Codable {
let data: [Place]
let msg: String
let status: Int
let statuscode: Int
}