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
class ProjectConfiguration extends sfProjectConfiguration | |
{ | |
public function setup() | |
{ | |
$this->enableAllPluginsExcept('sfDoctrinePlugin'); | |
// if(ENV == "dev"): | |
$this->setWebDir('/a/path'); | |
// else: | |
$this->setWebDir('a/different/path'); |
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
class MyClass | |
{ | |
static $choicesMaxChildren = array( | |
1 => '1', | |
2 => '2', | |
3 => '3', | |
4 => '4', | |
5 => '5', | |
6 => 'Whaaa! more than 5 ?', | |
); |
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
>> app Route "language_edit" for application "backend" | |
Name language_edit | |
Pattern /language/:id/edit.:sf_format | |
Class sfPropelRoute | |
Defaults action: 'edit' | |
module: 'language' | |
sf_format: 'html' | |
Requirements id: '\\d+' | |
sf_format: '[^/\\.]+' | |
sf_method: 'get' |
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
language GET /language.:sf_format | |
language_new GET /language/new.:sf_format | |
language_create POST /language.:sf_format | |
language_edit GET /language/:id/edit.:sf_format | |
language_update PUT /language/:id.:sf_format | |
language_delete DELETE /language/:id.:sf_format | |
language_show GET /language/:id.:sf_format | |
language_object GET /language/:id/:action.:sf_format | |
language_collection POST /language/:action/action.:sf_format |
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
# routing.yml | |
language: | |
class: sfPropelRouteCollection | |
options: | |
model: Language | |
module: language | |
prefix_path: language | |
column: id | |
with_wildcard_routes: true | |
requirememts: '\w+' |
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
# routing.yml | |
language: | |
class: sfPropelRouteCollection | |
options: | |
model: Language | |
module: language | |
prefix_path: language | |
column: id | |
with_wildcard_routes: true | |
requirememts: |
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
var request = require("request"); | |
var zlib = require("zlib"); | |
var csv = require("csv-streamify"); | |
var Handlebars = require("handlebars"); | |
var es = require("event-stream"); | |
var tmpl = Handlebars.compile("<li><a href="{{URL}}">{{Name}}</a> ({{City}})</li>"); | |
// HTTP GET Request | |
request("http://nodestreams.com/input/people.csv.gz") |
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
var totalH = 0; | |
var hours = document.getElementsByClassName('item-qty desktop'); | |
Array.prototype.forEach.call(hours, function(el) { totalH += parseFloat(el.innerHTML); }); | |
var totalRow = document.querySelector('tr.total'); | |
var totalLabelCol = document.querySelector('tr.total td.label'); | |
var totalAmoundCol = document.querySelector('tr.total td.total'); | |
var totalHoursCol = document.createElement('td'); | |
totalHoursCol.innerHTML = totalH; | |
totalRow.insertBefore(totalHoursCol, totalAmoundCol); |
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
/** | |
* run: | |
* $ casperjs diskusage.js --user=myaccount --password=mypassword | |
* | |
* This script can lookup for env variables: | |
* ALWAYSDATA_USER | |
* ALWAYSDATA_PASSWORD | |
*/ | |
var casper = require('casper').create({ | |
//verbose: true, |
NewerOlder