Skip to content

Instantly share code, notes, and snippets.

View tysweezy's full-sized avatar
💯

Tyler Souza tysweezy

💯
View GitHub Profile
@tysweezy
tysweezy / body.html
Created October 12, 2012 06:01 — forked from jonmarkgo/body.html
Twilio Phone Verification Blog Post
<form id="enter_number">
<p>Enter your phone number:</p>
<p><input type="text" name="phone_number" id="phone_number" /></p>
<p><input type="submit" name="submit" value="Verify" /></p>
</form>
<div id="verify_code" style="display: none;">
<p>Calling you now.</p>
<p>When prompted, enter the verification code:</p>
<h1 id="verification_code"></h1>
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@tysweezy
tysweezy / SomeClass.php
Created January 8, 2015 00:56
Just playing around..
<?php
use \SomeNamespace
class SomeClass {
/**
* demo variable
*
* @var somevar
@tysweezy
tysweezy / fabfile.py
Last active August 29, 2015 14:14 — forked from elliottb/fabfile.py
from fabric.api import local, run, env, put
import os, time
# remote ssh credentials
env.hosts = ['10.1.1.25']
env.user = 'deploy'
env.password = 'XXXXXXXX' #ssh password for user
# or, specify path to server public key here:
# env.key_filename = ''
@tysweezy
tysweezy / models.py
Created February 3, 2015 23:01
forum model
from django.db import models
# Create your models here.
class Post(models.Model):
title = models.CharField(max_length=200)
post_text = models.TextField()
pub_date = models.DateTimeField('date published')
# return string -- __unicode__ for python2
def __unicode__(self):
@tysweezy
tysweezy / tags.js
Created March 24, 2015 20:08
Get comma seperated values and append them to a url
(function () {
var values = $("#tags").map(function() {
return this.value;
}).get();
$('#btn').click(function() {
var arr = $('#tags').val().split(",").map(Number);
for (var i = 0; i < arr.length; i++) {
console.log(bugUrl(arr[i]));
@tysweezy
tysweezy / repo.php
Created March 26, 2015 20:37
Repository Pattern
<?php
interface UserRepository {
public function all();
public function create($input);
public function find($id);
@tysweezy
tysweezy / Repo.php
Created March 30, 2015 18:05
Trying to get the hang of the repository pattern
<?php
interface UserRepository {
/**
* return all users
*
*/
public function all();
@tysweezy
tysweezy / gulpfile.js
Last active August 29, 2015 14:20
My personal build system.
// need to fix this file
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var filter = require("gulp-filter");
var browserSync = require("browser-sync").create();
var reload = browserSync.reload;
gulp.task('serve', ['sass'], function() {
browserSync.init({
@tysweezy
tysweezy / UserInfoInterface.php
Last active August 29, 2015 14:22
User info repository for a new app I am working on
<?php
interface UserInfoInterface {
/**
* Get user by id
*
* @param $id
*/
public function getUserById($id);