Debounce a function when you want it to execute only once after a defined interval of time. If the event occurs multiple times within the interval, the interval is reset each time.
Example A user is typing into an input field and you want to execute a function, such as a call to the server, only when the user stops typing for a certain interval, such as 500ms.
Symfony2 and Angular.js make a great, robust combintaion. Integrating them isn't immediately obvious, however. Both communities come with their own standards and suite of tools for managing the development process, and sometimes those tools conflict.
On the Symfony side, you mainly deal with composer for managing your dependencies, a few Symfony commands in your project, and any other tools you add into the mix, like phpunit.
On the Angular side, you'll probably end up using npm, bower and probably grunt for automating some of the pain.
Here's an example application that uses the pattern detailed below: https://github.com/tantastik/talent-curator
This document is an attempt to describe the first step of a large project structure with flask and some basic modules:
- SQLAlchemy
- WTForms
Please feel free to fix and add your own tips.
""" | |
setup: | |
pip install requests | |
pip install requests[socks] | |
super helpful: | |
- http://packetforger.wordpress.com/2013/08/27/pythons-requests-module-with-socks-support-requesocks/ | |
- http://docs.python-requests.org/en/master/user/advanced/#proxies | |
""" |
import sqlalchemy | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Column, Integer, String, ForeignKey | |
from sqlalchemy.orm import sessionmaker, relationship, backref | |
from sqlalchemy.ext.associationproxy import association_proxy | |
import uuid | |
engine = sqlalchemy.create_engine('sqlite:///:memory:') | |
Base = declarative_base() | |
<?php | |
/** | |
* Illuminate DB Class | |
* | |
* @author rutoru | |
* @package Runa-CCA | |
* @license http://www.opensource.org/licenses/mit-license.php 2014 rutoru | |
*/ | |
namespace Runa_CCA\Model; |
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars
file, reference that vars
file from your task
, and encrypt the whole vars
file using ansible-vault encrypt
.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
/* | |
<?php | |
// THE FOLLOWING IMPLEMENTATION CAN BE USED FOR VARIOUS APIs. THIS WAS TESTED SUCCESSFULLY ON THE pingdom.com API | |
$email = "[email protected]"; | |
$passwd = 'password'; | |
$api_key = "API_KEY"; | |
$curl = curl_init(); |
* |