Skip to content

Instantly share code, notes, and snippets.

View darklow's full-sized avatar

Kaspars Sprogis darklow

View GitHub Profile
@Dattaya
Dattaya / 1. README.md
Created February 16, 2012 12:15
Symfony2.0.10. How to integrate assetic lessphp filter.

Symfony2.0.10. How to integrate assetic lessphp filter.

  • Add the following lines of code to the end of the deps file:
[lessphp]
    git=https://github.com/leafo/lessphp.git
    target=/lessphp
 version=v0.3.2
@phred
phred / pedantically_commented_playbook.yml
Last active February 26, 2025 14:19
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
@renoirb
renoirb / AbstractClient.php
Created July 9, 2012 06:04
How to use Guzzle in your bundle, the missing instructions
<?php
namespace Renoir\AggregationBundle;
/**
* Abstract client to use for each Client
*
* Example location: src/Renoir/AggregationBundle/AbstractClient.php
**/
@ivoba
ivoba / IndexController.php
Created July 10, 2012 10:15
symfony2 caching data via doctrine/commons
$cache = $this->get('cache');
$cache->setNamespace('mynamespace.cache');
if (false === ($cached_data = $cache->fetch($cache_key))) {
$cached_data = $SOMEAPI->getData($params);
$cache->save($cache_key, $cached_data, 3600);//TTL 1h
}
@ollietb
ollietb / 1. README.md
Created July 10, 2012 11:02 — forked from Dattaya/1. README.md
Symfony2.1.*. How to integrate assetic lessphp filter.

Symfony2.1. How to integrate assetic lessphp filter.

  • Add the following package to your composer.json:
"require": {
    ...
    "leafo/lessphp": "dev-master",
 ...
package main
import (
"github.com/AllenDang/w32"
"io"
"os"
"unsafe"
"errors"
"fmt"
"syscall"
@hinzundcode
hinzundcode / gist:3194587
Created July 28, 2012 20:05
Handle ControllerCollection without HttpKernel and Events
<?php
error_reporting(E_ALL + E_STRICT);
require_once __DIR__.'/../vendor/autoload.php';
use Silex\Application;
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\RequestContext;
@justinfay
justinfay / redisbucket.py
Created August 20, 2012 13:01
redis token bucket
import redis
from redis import WatchError
import time
RATE = 0.1
DEFAULT = 100
TIMEOUT = 60 * 60
DEBUG = False
@igorw
igorw / FooController.php
Created September 5, 2012 22:13
Silex convention-based controllers
<?php
// src/Foobar/Controller/FooController.php
namespace Foobar\Controller;
class FooController
{
public function helloAction($request)
{
@zed
zed / test_utc_to_dst.py
Created October 5, 2012 08:55
can't get correct time during DST using dateutil (pytz works)
# based on https://launchpadlibrarian.net/94884626/testUtcToDst.patch
# from https://bugs.launchpad.net/dateutil/+bug/944123
import unittest
from datetime import datetime, timedelta
import dateutil.tz
import dateutil.zoneinfo
import pytz
tzname = "America/Toronto"