This file contains 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
# create a local repo | |
git init | |
# create a remote repo | |
git --base init | |
# add a file to tracking | |
git add lemon.css | |
# add all files to tracking |
This file contains 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
/*jslint nomen: true */ | |
/*global console, define, Backbone, $, _ */ | |
define([ | |
'backbone' | |
], function () { | |
'use strict'; | |
var _session = null, _instantiated = false; |
This file contains 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 | |
if (PHP_VERSION >= 50400) { | |
function jsonEncode(){ | |
return call_user_func_array('json_encode', (array)func_get_args()); | |
} | |
}else{ | |
interface JsonSerializable{ |
This file contains 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 | |
/** | |
* None of this works, just an idea. | |
* | |
* Idea is a REST based framework for backend of Backbonejs | |
* | |
* @twitter gsphpdev | |
*/ |
This file contains 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
/** | |
* This section of code was taken from here | |
* http://de.60.5646.static.theplanet.com/samples/distance.php.html | |
*/ | |
function calcDistance($lat, $long2, $lat2, $long2, $unit='m') | |
{ | |
$theta = $lon1 - $lon2; | |
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); | |
$dist = acos($dist); |
This file contains 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
Etag request headers | |
https://github.com/documentcloud/backbone/issues/284 |
This file contains 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 | |
namespace Utilities; | |
class Hash | |
{ | |
const PASSWORD_STRENGTHENING = 50000; | |
/** |
This file contains 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 | |
require_once __DIR__ . '/WideImage/lib/WideImage.php'; | |
$image = WideImage::load(__DIR__ . '/product_1.jpg') | |
->resize(300,150,'outside') | |
->crop("center", "middle", 300, 150) | |
->saveToFile('ff.jpg'); |
This file contains 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 | |
namespace Application; | |
use Zend\Mvc\MvcEvent; | |
class Module | |
{ | |
public function onBootstrap(MvcEvent $e) |
This file contains 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
#import the required modules | |
import RPi.GPIO as GPIO | |
import time | |
# set the pins numbering mode | |
GPIO.setmode(GPIO.BOARD) | |
# Select the GPIO pins used for the encoder K0-K3 data inputs | |
GPIO.setup(11, GPIO.OUT) | |
GPIO.setup(15, GPIO.OUT) |