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
angular.module('app.resources', ['ngResource']) | |
.factory('api', function ($resource) { | |
var api = { | |
defaultConfig : {id: '@id'}, | |
extraMethods: { | |
'update' : { | |
method: 'PUT' | |
} |
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
install + required bundles: | |
> composer create-project symfony/framework-standard-edition rest 2.2.0 | |
> cd rest | |
> composer require jms/serializer-bundle @stable | |
> composer require friendsofsymfony/rest-bundle @stable | |
> app/console --verion | |
[symfony version 2.2.0 - app/dev/debug] | |
> app/console generate:bundle | |
.... |
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
// | |
if(typeof(readability) === "undefined"){ | |
readability = {}; | |
} | |
(function (readability) { | |
readability.baseUrl = 'https://www.readability.com'; | |
readability.type = 'read'; |
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 | |
/** | |
* Arc90's Readability ported to PHP for FiveFilters.org | |
* Based on readability.js version 1.7.1 (without multi-page support) | |
* ------------------------------------------------------ | |
* Original URL: http://lab.arc90.com/experiments/readability/js/readability.js | |
* Arc90's project URL: http://lab.arc90.com/experiments/readability/ | |
* JS Source: http://code.google.com/p/arc90labs-readability | |
* Ported by: Keyvan Minoukadeh, http://www.keyvan.net | |
* More information: http://fivefilters.org/content-only/ |
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 | |
/** | |
* JavaScript-like HTML DOM Element | |
* | |
* This class extends PHP's DOMElement to allow | |
* users to get and set the innerHTML property of | |
* HTML elements in the same way it's done in | |
* JavaScript. | |
* | |
* Example usage: |
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 | |
class Controller_Rest_Ajax_City extends Controller_Rest_Ajax { | |
public function before() { | |
parent::before(); | |
} |
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
create a module to reverse a html form into drupal form definition | |
to see a certain file as it was in a certain commit | |
git show commit:path/to/file >something | |
MAC clipboard is called pbcopy : | |
echo "blah" | pbcopy | |
to create an empty (bare) repo: |
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
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# User specific aliases and functions | |
#0 Reset all attributes | |
#1 Bright |
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
set expandtab | |
set ts=2 | |
set sw=2 | |
"set foldmethod marker | |
set hlsearch | |
hi Comment ctermfg=lightgray | |
ab klog Kohana::log('debug', |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Word counter</title> | |
<style type="text/css"> | |
div.textareas textarea { | |
vertical-align: middle; | |
} |