<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
var pubsub = {}; | |
(function(q) { | |
var topics = {}, subUid = -1; | |
q.subscribe = function(topic, func) { | |
if (!topics[topic]) { | |
topics[topic] = []; | |
} | |
var token = (++subUid).toString(); | |
topics[topic].push({ | |
token: token, |
<?php | |
use Doctrine\ORM\Query\SqlWalker; | |
/** | |
* Quick hack to allow adding a USE INDEX on the query | |
*/ | |
class UseIndexWalker extends SqlWalker | |
{ | |
const HINT_USE_INDEX = 'UseIndexWalker.UseIndex'; |
#/bin/bash | |
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
if [ -z "$REPO_URL" ]; then | |
echo "-- ERROR: Could not identify Repo url." | |
echo " It is possible this repo is already using SSH instead of HTTPS." | |
exit | |
fi |
<style type="text/css"> | |
a.user-image { | |
background: transparent no-repeat top left; | |
display: block; | |
text-indent: -999em; | |
width: 50px; | |
height: 50px; | |
border-radius: 5px; | |
box-shadow: 0px 0px 3px #666; | |
} |
<?php | |
protected function flushQueue() | |
{ | |
$container = $this->getContainer(); | |
$transport = $container->get('mailer')->getTransport(); | |
$spool = $transport->getSpool(); | |
$spool->flushQueue($container->get('swiftmailer.transport.real')); |
Backbone.sync = function(method, model, options) { | |
// App.db is my database connection | |
if(_.isNull(App.db)) console.error('No Database connection!'); | |
var query = BackboneDb.createQuery(method, model, options); | |
if (method === "read") { | |
var data = App.db.execute(query); | |
var resultJSON = BackboneDb.resultToJSON(data); | |
console.log(resultJSON); |
<?php | |
// src/YourApp/Bundle/YourBundle/Twig/ToArrayExtension.php | |
namespace Appcito\Bundle\CoreBundle\Twig; | |
/** | |
* A simple twig extension that adds a to_array filter | |
* It will convert an object to array so that you can iterate over it's properties | |
*/ | |
class ToArrayExtension extends \Twig_Extension |
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/base64" | |
"fmt" | |
"io" | |
) |
<span | |
class="ordinal" | |
data-number="22"> | |
22 | |
</span> | |
<span | |
class="ordinal" | |
data-number="0"> | |
0 | |
</span> |