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
FROM php:5.6-fpm | |
# compile + install xdebug | |
RUN curl -SL "http://xdebug.org/files/xdebug-2.3.3.tgz" -o xdebug.tar.xz \ | |
&& mkdir -p /usr/src/xdebug \ | |
&& tar -xof xdebug.tar.xz -C /usr/src/xdebug --strip-components=1 \ | |
&& rm xdebug.tar.xz \ | |
&& cd /usr/src/xdebug \ | |
&& phpize \ | |
&& ./configure \ |
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 | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
$response = [ | |
'success' => false, | |
'lowest_price' => null, | |
'volume' => null, | |
'median_price' => 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 | |
######################### | |
#TEN SECOND PDO TUTORIAL# | |
######################### | |
//Connect, providing any parameters your connection requires, along with username and password | |
$db = new PDO('mysql:host=localhost;db=ashleymadison.com;charset=uft8', 'user', 'pass'); | |
//Set the error mode so that it throws exceptions rather outputting an error | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
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 | |
function coalesce(&$value, $ifnull=null) | |
{ | |
if(!isset($value)) | |
{ | |
return $ifnull; | |
} | |
return $value; | |
} |
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
/* Tomorrow Night Eighties Theme */ | |
/* Original theme - https://github.com/chriskempson/tomorrow-theme */ | |
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ | |
.tomorrow-comment, pre .comment, pre .title { | |
color: #999999; | |
} | |
.tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { | |
color: #f2777a; | |
} |
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
DataManager.getSysDeviceCompatibility { (data) -> Void in | |
var parseError: NSError? | |
let parsedObject: AnyObject? = NSJSONSerialization.JSONObjectWithData(data, | |
options: NSJSONReadingOptions.AllowFragments, | |
error:&parseError) | |
//2 | |
if let devices = parsedObject as? NSDictionary { | |
if let feed = devices["feed"] as? NSDictionary { | |
if let deviceEntry = feed["entry"] as? NSArray { |
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
@font-face { | |
font-family: mensch; | |
src: url('../fonts/mensch-webfont.woff'); | |
} | |
@font-face { | |
font-family: menlo; | |
src: url('../fonts/menlo-webfont.woff'); | |
} | |
@font-face { | |
font-family: monaco; |
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 | |
$db = new PDO("mysql:dbname=mydb;host=localhost", $user, $password); | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
function get_row($parent_id) | |
{ | |
global $db; //I would normally never do this, but its simpler than explaining the concept of a singleton | |
$parent_id = (int) $parent_id; //Cast to int |
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
{ | |
"codeformatter_css_options": | |
{ | |
"end_with_newline": true, | |
"indent_char": " ", | |
"indent_size": 4, | |
"indent_with_tabs": true, | |
"selector_separator_newline": true | |
}, | |
"codeformatter_js_options": |
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
{ | |
"color_scheme": "Packages/User/Colorsublime/themes/Chelevra.tmTheme", | |
"font_face": "Menlo", | |
"font_size": 13, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"sidebar_small": true, | |
"tabs_small": true, |