This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
~>php bench.php | |
md5_file 634.3932 ms | |
hash_file/md5 714.4802 ms | |
parse contents 911.6130 ms | |
parse contents substr 852.8361 ms | |
contents first chunk 590.0660 ms | |
all ran with 30000 itterations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shitty tmux bootstrap script for auto-login and session planning | |
SESSIONNAME="hack" | |
hash tmux || { echo "Could not find tmux? Ensure it's in \$PATH" ; exit 1 ;} | |
check_session() { | |
tmux list-sessions | cut -d ':' -f '1'| \ | |
egrep "^""$SESSIONNAME""\$" 2>&1 > /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public $has_and_belongs_to_many = array( | |
'add_on_order_status'=>array( | |
'class_name'=>'Shop_StatusTransition', | |
'primary_key'=>'psinventory_param_id', | |
'foreign_key' => 'shop_status_transition_id', | |
'join_table' => 'psinventory_params_shop_status_transitions', | |
'join_fields' => array( | |
'transition_flag' => 'active' | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2011 Martin Hawksey | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// File containing cronjobs | |
$cronFile = dirname(__FILE__) . '/crontab'; | |
// Lockfile to prevent multiple instances | |
$pidFile = dirname(__FILE__) . '/cron.lock'; | |
// Exit file to signal a running instance to exit | |
$exitFile = dirname(__FILE__) . '/cron.exit'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php apache_setenv("DOCUMENT_ROOT",$_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME'])) ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
LOCAL_BRANCH="master" | |
LIVE_BRANCH="live" | |
REMOTE_NAME="deploy" | |
if [ "$(git symbolic-ref -q HEAD)" != "refs/heads/${LOCAL_BRANCH}" ]; then | |
echo "Not on ${LOCAL_BRANCH}, not deploying" | |
exit 1 | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$grouped_product = new Shop_Product(null, array('no_validation' => true, 'no_column_init' => true, 'no_timestamps' => true)); | |
$data = $_POST['Shop_Product']; | |
$data['grouped'] = 1; | |
$data['name'] = $product->name . ' ('.$attributes->name.')'; | |
$data['url_name'] .= '_'.uniqid('', true); | |
$data['sku'] .= '-' . strtolower($attributes->sku.uniqid('', true)); | |
$data['grouped_option_desc'] = $attributes->name; | |
$data['x_aga_ids'] = join(':', $ids); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
/** | |
* Monokai Extended Color Scheme | |
* Author: Jon Schlinkert | |
* Link: https://github.com/jonschlinkert/sublime-monokai-extended | |
*/ | |
"color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme", | |
/** |
OlderNewer