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
#!/bin/sh | |
phpunit -c /PATH_TO_SYMFONY/app |
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
#!/bin/sh | |
unset GIT_INDEX_FILE | |
export GIT_WORK_TREE=/example.com/ | |
export GIT_DIR=/home/whoever/development/web-project/.git/ | |
git checkout -f |
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 | |
$a = new A(); | |
$reflection = new \ReflectionClass($a); | |
$property = $reflection->getProperty('privateProperty'); | |
$property->setAccessible(true); | |
$property->setValue($a, 'new-value'); | |
echo $a->getPrivateProperty(); | |
//outputs: |
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
// Our redis client | |
$redis = $this->getContainer()->get("redis_client"); | |
// Set the key | |
$key = 'my_key'; | |
// predis transaction options | |
$options = array( | |
'cas' => true, // Initialize with support for CAS operations | |
'watch' => $key, // Key that needs to be WATCHed to detect changes |
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
# nvidia-xconfig: X configuration file generated by nvidia-xconfig | |
# nvidia-xconfig: version 346.47 (buildmeister@swio-display-x86-rhel47-01) Thu Feb 19 19:19:45 PST 2015 | |
# Modified by Sam Hudson (sam.hudson@thefoundry.co.uk). Added Headless monitor, for use without a physical screen. | |
Section "Monitor" | |
Identifier "Headless" | |
HorizSync 80.0 - 80.0 | |
VertRefresh 75.0 | |
Modeline "1280x1024_75.00" 138.45 1280 1368 1504 1728 1024 1025 1028 1069 -Hsync +Vsync | |
EndSection |
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
function addCameraGizmos() { | |
cameraControl = new THREE.TransformControls(ThreeCameraService.cameras[0], ThreeRendererFactory.renderer.domElement); | |
cameraControl.attach(ThreeCameraService.cameras[1]); | |
ThreeSceneService.scene.add(cameraControl); | |
var renderCameraHelper = new THREE.CameraHelper(ThreeCameraService.cameras[1]); | |
ThreeSceneService.scene.add(renderCameraHelper); |
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
def get_images(vin, host, d=0): | |
""" | |
- Return a list of lists of images on disk for the give vin, younger than 'days' | |
List objects: [ index, image_url ] | |
- Don't return _thumbs. | |
""" | |
days = int(d) | |
image_list = [] | |
now = time.time() | |
try: |
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 | |
// setup file cache - CCP wants you to respect their cache timers, meaning | |
// some of the API Pages will return the same data for a specific while, or worse | |
// an error. If you use one of the availabe caching implementations, | |
// pheal will do the caching transparently for you. | |
// in this example we use the file cache, and configure it so it will write the cache files | |
// to /tmp/phealcache | |
Config::getInstance()->cache = new \Pheal\Cache\FileStorage('cache/'); |
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
__author__ = 'laurie' | |
import bottle | |
import os | |
from bottle import route, run, template, static_file | |
from pymongo import MongoClient | |
bottle.TEMPLATE_PATH.insert(0, '/home/laurie/devops_tools/table_drop') |
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
/** | |
* Return the current user from the config object, if its present. | |
* | |
* @return {User} | |
*/ | |
public getCurrentUser(): User { | |
var _json = { | |
username: "sam", | |
name: "Sam Hudson", |
OlderNewer