Skip to content

Instantly share code, notes, and snippets.

@microweber
microweber / haus_frontend_dev.md
Created December 15, 2011 01:56 — forked from jared57/haus_frontend_dev.md
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.

@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',
@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();
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@microweber
microweber / gist:3663864
Created September 7, 2012 06:37
PHp read large file
/**
* Demonstrate an efficient way to search the last 100 lines of a file
* containing roughly ten million lines for a sample string. This should
* function without having to process each line of the file (and without making
* use of the “tail” command or any external system commands).
*/
$filename = '/opt/local/apache2/logs/karwin-access_log';
$searchString = 'index.php';
$numLines = 100;
@microweber
microweber / gist:3683058
Created September 9, 2012 06:52
Gets a string between two key words and/or phrases.
<?php
function textbetweenarray($s1,$s2,$s){
$myarray=array();
$s1=strtolower($s1);
$s2=strtolower($s2);
$L1=strlen($s1);
$L2=strlen($s2);
$scheck=strtolower($s);
do {
@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:
<?php
function svgScaleHack($svg, $minWidth, $minHeight)
{
$reW = '/(.*<svg[^>]* width=")([\d.]+px)(.*)/si';
$reH = '/(.*<svg[^>]* height=")([\d.]+px)(.*)/si';
preg_match($reW, $svg, $mw);
preg_match($reH, $svg, $mh);
if(!isset($mw[2]) and isset($mh[2])){
$mw[2] = $mh[2];
@microweber
microweber / Cpanel auto make db
Created July 12, 2013 12:26
Cpanel auto make db
http://forums.cpanel.net/f42/auto-creation-mysql-db-postwwwacct-166494.html
#!/usr/bin/php -q
<?php
//set error handling so any warnings are logged
ini_set('error_log','/usr/local/cpanel/logs/error_log');
ini_set('display_errors',0);
<?php
action_hook('before_user_login', 'my_user_login');
function my_user_login($params)
{