Skip to content

Instantly share code, notes, and snippets.

@noodlehaus
noodlehaus / web_app.php
Last active December 15, 2017 06:39
bare bones routing function for PHP.
<?php
// minimal routing
function web_app($routes, $req_verb, $req_path) {
$req_verb = strtoupper($req_verb);
$req_path = trim(parse_url($req_path, PHP_URL_PATH), '/');
$found = false;
if (isset($routes[$req_verb])) {
<?php
//original article is here http://css-tricks.com/snippets/php/sanitize-database-inputs/
function cleanInput($input) {
$search = array(
'@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
@microweber
microweber / MW.md
Last active December 20, 2015 22:19
Micreoweber doc

Microweber: the Drag-and-Drop CMS

Microweber is a content management system of new generation that allows you to make your website by drag and drop.

You can easily manipulate the content and the layout of your pages without the need to write code.

Try the demo here

Download the latest version from here

@jan-j
jan-j / Print an associative array as an ASCII table
Last active August 8, 2018 07:53
My solution to the task "Print an associative array as an ASCII table". More info can be found on task author page: http://phpixie.com/blog/test-tasks-for-php-interviews-that-developers-will-enjoy-solving/
<?php
const SPACING_X = 1;
const SPACING_Y = 0;
const JOINT_CHAR = '+';
const LINE_X_CHAR = '-';
const LINE_Y_CHAR = '|';
$table = array(
array(
@microweber
microweber / LICENSE
Created November 11, 2012 14:07 — forked from mcollina/LICENSE
NetworkButton MQTT Example
Copyright (c) 2008-2012 Nicholas O'Leary
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@xeoncross
xeoncross / twitterexport.php
Created August 9, 2012 19:10 — forked from rutger1140/twitterexport.php
Export all your tweets
<?php
/**
* This script will allow the export of complete user time-lines from the twitter
* service. It joins together all pages of status updates into one large XML block
* that can then be reformatted/processed with other tools.
*
* @since 10/13/08
*
* @copyright Copyright © 2008, Adam Franco
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
@microweber
microweber / php background tasks
Created July 27, 2012 06:15
php background tasks
<?php
ignore_user_abort();
set_time_limit(0);
ob_start(); // This is required
include 'somefile.php';
echo $someString;
$content_size = ob_get_length();
@microweber
microweber / php_functions_list.php
Created July 26, 2012 17:46
php functions list
<?
$luminous_php_functions = array(
'Phar',
'PharData',
'PharException',
'PharFileInfo',
'abs',
'acos',
@jared57
jared57 / haus_frontend_dev.md
Created December 15, 2011 00:26
Wanted : Front-End Web Developer @ HAUS

FRONT-END WEB DEVELOPER @ HAUS

Los Angeles based integrated production company HAUS is looking for ‘full time’ mid to senior level front-end web developers for a variety of interactive projects. You will work as part of a creative development team led by our director of technology and interactive producers. Projects may include Facebook Apps, YouTube Brand Channels, websites, web apps, mobile apps, etc.

We are looking for developers with creative sensibilities. We are a creative driven company and encourage everyone on the team to contribute their own ideas and inspirations to the group. The Details

TERM: 1-3 month contract to start, with intention of permanent position thereafter.

LOCATION: Ideally our Los Angeles office, but can be remote anywhere in the world. If international, you will need to be able to work within our PST daytime window.