Skip to content

Instantly share code, notes, and snippets.

View tchalvak's full-sized avatar
🐙
making another SPA

Roy R. tchalvak

🐙
making another SPA
View GitHub Profile
@tchalvak
tchalvak / templater_summary.markdown
Created July 11, 2012 12:30
Summary of PHP Webdesigner & Coder Post

PHP Webdesigner & Assistant Coder

=Please answer some of the questions below to receive any consideration of your application=

BitLucid, Inc. is looking for a part-time webdesigner & php programmer:

  • Initially, you will be taking PHP scripts containing html, css, javascript and PHP, and cleaning them up into:
    1. templates with html/javascript/css and no php logic and
  1. PHP scripts with no html in them and all the php logic
@tchalvak
tchalvak / belts_example.php
Created June 10, 2012 20:19
Example of code for the belts.php page.
<?php
require_once(CORE.'core.php') // Includes core systems, a templating engine, any mvc framework, etc.
/* ================== Intro ===========================================
Ok, so this is an example like many of our current scripts, which it should be obvious need a lot of refactoring to be more useful.
This should be split into (at least) two php scripts, one that's an html template, and one that includes all the php logic.
You can pretend that there's a template engine and/or MVC system of your choice available to use and just show me whatever kind of templating syntax
or MVC approach you're familiar with.
@tchalvak
tchalvak / odesk_profile.txt
Created June 10, 2012 19:50
Improved Odesk Profile
In a sentence, I code PHP web apps. I have coded and improved upon the browser based game NinjaWars.net ( http://ninjawars.net ) as a personal project since 2003, have been professionally freelancing building customized web applications and working with a PHP/MySQL based CMS for the last 4 years, and have been designing websites in html/css long before that. In 2011 I co-founded my corporation with my business partner and we have been building up our small business since.
For me, security is paramount. I've seen too many sites burned by bad php coding practices and under attack by sql-injection as a result. I've done a lot of security cleanup work on sites that were coded by programmers without any oversight that resulted in compromised database data and a site that -looked- fine but was full of security holes. And generally one of the first things that I do with a site is I review it's password security for the presence of strong security, that's frequently another pain point with the standard php websi
@tchalvak
tchalvak / templater.markdown
Created June 10, 2012 18:17
PHP Web Templater & Coder

PHP Web Programming Template Coder & Assistant Coder

BitLucid, Inc. is looking for a part-time php programmer to:

  • perform conversions from php scripts with a mixture of php, html, and javascript into:
  1. php templates with html/javascript/css and minimal php logic and
  2. php scripts with no html in them, but all the php logic.
  • You will also be coding web test suite cases and doing QA on upcoming code releases.

Bitlucid.com is our (work-in-progress) company website. shermanbrothers.com is our main client, and the site that you'll be working on the php scripts of. You will be taking existing scripts one by one, separating out the html from the php, making sure all variables are properly escaped, and creating two scripts (or script + template file) that result, with the goal of keeping the html output the same for the same input. You will also be reviewing changes by browsing our development site and looking for breakages. Eventually you'll write tests in php to

@tchalvak
tchalvak / SRA install steps
Created February 11, 2012 05:13
Install steps for SRA.
Install Steps
-------------
Download codeigniter (CodeIgniter_2.1.0 currently) zip, just google it.
Unzip codeigniter somewhere, and steal the contents of the /system/ folder within it. Copy everything in /system/*, and paste those folders into SRA's /system/ folder to form the running core of codeigniter for SRA.
(Only the /system/libraries/Zend folder need be retained)
Create Database:
createdb sra;
createlang plpgsql sra;
@tchalvak
tchalvak / inline_template_test.php
Created September 7, 2011 22:19
PHP inline templating craziness.
<?php
// System for using simple, native php templates.
// TODO: Put this in a namespace to keep it clean and seperate.
function display_page_inline($templates, $options, $data){
$title = @$options['title'];
echo "<html><head><title>".htmlentities($title)."</title></head>";
if(is_array($templates)){
@tchalvak
tchalvak / Bcrypt.php
Created August 17, 2011 16:17
Simple PHP 5.3+ Bcrypt functions
<?php
// ================================================================================================================
// Bcrypt hashing and hash checking wrapper functions for simplified, secure password encryption
// ================================================================================================================
// Create a bcrypt_hash.
function bcrypt_hash($password, $work_factor = 8)
{
@tchalvak
tchalvak / Bcrypt.php
Created August 5, 2011 17:26
Simple PHP 5.3+ Bcrypt class and functions
<?php
/*
By Marco Arment <me@marco.org>.
This code is released in the public domain.
THERE IS ABSOLUTELY NO WARRANTY.
Usage example:
// In a registration or password-change form:
tchalvak:~/ninjawars/deploy$ cat lib/common/lib_input.php
<?php
/*
* Deals with getting and filtering user input (just from request).
*
* @package input
*/
// Input function that by default LEAVES INPUT COMPLETELY UNFILTERED
// To not filter some input, you have to explicitly pass in null for the third parameter,
#!/bin/sh
cd ~/bin
curl -O http://github.com/technomancy/leiningen/raw/stable/bin/lein
chmod 755 lein
lein self-install
cd /tmp
mkdir garden
cd garden/
cat >project.clj <<EOF