Skip to content

Instantly share code, notes, and snippets.

View ctrl-freak's full-sized avatar

Bryce Sheehan ctrl-freak

View GitHub Profile
@darkcolonist
darkcolonist / utf8ize.php
Last active February 11, 2016 06:06
utf8ize json encode fix
/**
* fixes the encoding of the values in an associative array
*
* usage:
* $formatted_rows = util::utf8ize($formatted_rows);
* echo json_encode($formatted_rows);
*
* @param assoc $arr array to be processed
* @return assoc processed array
*/
@papaponmx
papaponmx / Contract Killer 3.md
Created February 11, 2016 05:35 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post

$symbols = [PSCustomObject] @{
SMILEY_WHITE = ([char]9786)
SMILEY_BLACK = ([char]9787)
GEAR = ([char]9788)
HEART = ([char]9829)
DIAMOND = ([char]9830)
CLUB = ([char]9827)
SPADE = ([char]9824)
CIRCLE = ([char]8226)
NOTE1 = ([char]9834)
@skymarionsky
skymarionsky / _autocomplete.php
Last active June 1, 2016 11:43 — forked from kenjis/_autocomplete.php
For FuelPHP, works on PHPStorm.
<?php
class Asset_Instance extends Fuel\Core\Asset_Instance {}
class Cache_Handler_Json extends Fuel\Core\Cache_Handler_Json {}
class Cache_Handler_Serialized extends Fuel\Core\Cache_Handler_Serialized {}
class Cache_Handler_String extends Fuel\Core\Cache_Handler_String {}
class Cache_Storage_Apc extends Fuel\Core\Cache_Storage_Apc {}
abstract class Cache_Storage_Driver extends Fuel\Core\Cache_Storage_Driver {}
class Cache_Storage_File extends Fuel\Core\Cache_Storage_File {}
class Cache_Storage_Memcached extends Fuel\Core\Cache_Storage_Memcached {}
@othtim
othtim / gist:5936956
Created July 5, 2013 20:14
stats in pre- and post- reindex fragmentation
--save PRE stats on index fragmentation
IF OBJECT_ID('tempdb..#tmp_PRE_reindex', 'U') IS NOT NULL DROP TABLE #tmp_PRE_reindex
SELECT
ROW_NUMBER() over (order by sDips.index_id) as 'rowid',
OBJECT_NAME(sDips.OBJECT_ID) as 'objid',
@othtim
othtim / gist:5936927
Last active October 24, 2018 00:42
shows reads/writes on all tables in a DB as percentages. for choosing better indexes
--show stats on table reads/writes
Select
object_schema_name(UStat.object_id) + '.' + object_name(UStat.object_id) As [Object Name],
Case
When sum(User_Updates + User_Seeks + User_Scans + User_Lookups) = 0
Then Null
Else convert(decimal(5,2),round(Cast(sum(User_Seeks + User_Scans + User_Lookups) As Decimal)
/ Cast(sum(User_Updates
@banaslee
banaslee / XGH - en.txt
Last active June 5, 2024 00:29
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Source: http://gohorseprocess.wordpress.com
1. I think therefore it's not XGH.
In XGH you don't think, you do the first thing that comes to your mind. There's not a second option as the first one is faster.
2. There are 3 ways of solving a problem: the right way, the wrong way and the XGH way which is exactly like the wrong one but faster.
XGH is faster than any development process you know (see Axiom 14).