Skip to content

Instantly share code, notes, and snippets.

View nhalstead's full-sized avatar
👨‍💻
Something. Maybe cool

Noah Halstead nhalstead

👨‍💻
Something. Maybe cool
View GitHub Profile
@tony-landis
tony-landis / smarty.json.php
Created December 3, 2008 07:15
Smarty JSON Plugin (PHP)
<?php
/**
* Smarty {json} plugin
*
* Type: function
* Name: json
* Purpose: fetch json file and assign result as a template variable (array)
* @author Tony Landis
* @copyright 2007 Tony Landis
* @website http://www.tonylandis.com
@tony-landis
tony-landis / smarty.function.soap.php
Created December 3, 2008 07:23
Smarty Soap Plugin (PHP)
<?php
/**
* Smarty {soap} plugin
*
* Type: function<br>
* Name: soap<br>
* Purpose: post http data and display results from soap webservice
* Params: url, post(true/false - passes along orig params), assign,
* Usage: {soap assign=soapResponse
* endpoint=http://www.site.com/search.soap
<?php
$data = array(
array('company'=>'AIG', 'id'=>1, 'balance'=> '-$99,999,999,999.00'),
array('company'=>'Wachovia', 'id'=>2, 'balance'=> '-$10,000,000.00'),
array('company'=>'HP', 'id'=>3, 'balance'=> '$555,000.000.00'),
array('company'=>'IBM', 'id'=>4, 'balance'=> '$12,000.00')
);
$renderer = new ArrayToTextTable($data);
@jeffrafter
jeffrafter / handler.js
Created April 2, 2010 20:59
Simple HTTP Server and Router in node.js
exports.createHandler = function (method) {
return new Handler(method);
}
Handler = function(method) {
this.process = function(req, res) {
params = null;
return method.apply(this, [req, res, params]);
}
}
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@jakebellacera
jakebellacera / ICS.php
Last active July 10, 2024 11:27
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@dawsontoth
dawsontoth / postingToGitHub.html
Created March 14, 2011 17:59
How to post Gists to GitHub
<html>
<head>
<style type="text/css">
body {
font: 14px Verdana, Geneva, sans-serif;
height: 500px;
width: 700px;
margin: 10px 20px;
}
@nicolas-grekas
nicolas-grekas / Advanced-HTTP-en.md
Created June 15, 2011 22:03
Advanced handling of HTTP requests in PHP
@veganstraightedge
veganstraightedge / gist:1063033
Created July 4, 2011 08:05
blacklist of usernames
about
account
add
admin
api
app
apps
archive
archives
auth
<?
require_once "php_cache.php";
echo 123456;
phpinfo();