Skip to content

Instantly share code, notes, and snippets.

View akd3vs's full-sized avatar

André K. Contreras Jiménez akd3vs

  • Softtek
  • México
View GitHub Profile
import { combineReducers } from 'redux-immutable';
import rootReducers from 'store/rootReducers';
const rootReducer = { rootReducers };
export const createReducer = asyncReducers => combineReducers({ ...rootReducer, ...asyncReducers });
export default combineReducers(rootReducer);

Keybase proof

I hereby claim:

  • I am akd3vs on github.
  • I am andrekarell (https://keybase.io/andrekarell) on keybase.
  • I have a public key whose fingerprint is E722 68F8 1198 F2B1 8D63 CD4F 93FC 6EDC D836 B4DC

To claim this, I am signing this object:

@akd3vs
akd3vs / strong-passwords.php
Last active August 29, 2015 14:26 — forked from tylerhall/strong-passwords.php
A user friendly, strong password generator PHP function.
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
public function execute(InputInterface $input, OutputInterface $output)
{
$container = $this->getContainer();
/** @var Configurator $configurator */
$configurator = $container->get('nettic_wholesalers.config');
$configurator->isBackgroundProcess = true;
$bjRepository = $configurator->getRepository('backgroundJob');
<?php
// usage: $newpassword = generatePassword(12); // for a 12-char password, upper/lower/numbers.
// functions that use rand() or mt_rand() are not secure according to the PHP manual.
function getRandomBytes($nbBytes = 32)
{
$bytes = openssl_random_pseudo_bytes($nbBytes, $strong);
if (false !== $bytes && true === $strong) {
return $bytes;
}
@akd3vs
akd3vs / config.yml
Created May 4, 2015 19:48
Symfony for puphpet
vagrantfile:
target: local
vm:
box: puphpet/ubuntu1404-x64
box_url: puphpet/ubuntu1404-x64
hostname: bepcgo.dev
memory: '4096'
cpus: '3'
chosen_provider: virtualbox
network:
function onlyStatic (middleware) {
return function (req, res, next) {
var match = /(\.css|\.eot|\.gif|\.html|\.js|\.png|\.svg|\.ttf|\.woff)($|\?.*$)/ig.exec(req.originalUrl);
if (!match) return next();
middleware(req, res, next);
};
}
//usage
this.use(onlyStatic(express.static(__dirname + "/public")));
<?php
send_email_template('contacto_empresa_no_registrada', $attrs = array(
'title' => 'Alguien pide informacion de su franquicia en nuestro portal Franquiciame.com',
'email' => $companyUnregistered
));
function render_email_template($template_name, $attrs = array(), $cached = true) {
include 'Twig/Autoloader.php';
Twig_Autoloader::register();
@akd3vs
akd3vs / gist:3054899
Created July 5, 2012 17:03
pip fabric
[root@s15433942 ~]# /usr/local/bin/easy_install pip
Searching for pip
Reading http://pypi.python.org/simple/pip/
Reading http://pip.openplans.org
Reading http://www.pip-installer.org
Best match: pip 1.1
Downloading http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz#md5=62a9f08dd5dc69d76734568a6c040508
Processing pip-1.1.tar.gz
Running pip-1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-pCKBmq/pip-1.1/egg-dist-tmp-gYp3Pw
warning: no files found matching '*.html' under directory 'docs'
@akd3vs
akd3vs / gist:3053819
Created July 5, 2012 13:58
stdout + stderr of Python upgrade on CentOS 5.8
----------------------------------------------------
Installing required packages...
----------------------------------------------------
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
addons | 1.9 kB 00:00
base | 1.1 kB 00:00
extras | 2.1 kB 00:00
updates | 1.9 kB 00:00