Skip to content

Instantly share code, notes, and snippets.

View fforres's full-sized avatar
🔥

Felipe Torres (fforres) fforres

🔥
View GitHub Profile
@fforres
fforres / gist:8f493e169af80d6e8ac6e7f2cb4406ef
Last active August 4, 2016 20:48
setting up digitalocean's instance of neo4j
free -m
df -h
sudo fallocate -l 1500M /swapfile
df -h
sudo chmod 600 /swapfile
ls -lh /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -m
sudo nano /etc/fstab
@fforres
fforres / pr.md
Created July 30, 2016 05:41 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

export async function getCoworkByName(name) {
try {
const coworkByName = await getCoworkByNameAsync(name); //Devuelve el objeto del siguiente file
console.log(coworkByName);
return coworkByName;
} catch (err) {
console.log(err);
return err;
}
}
<VirtualHost *:80>
ServerName myapp.localhost.com
DocumentRoot "/home/vagrant/projects/myapp/public"
<Directory "/home/vagrant/projects/myapp/public">
AllowOverride all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName myapp.localhost.com
DocumentRoot "/home/vagrant/projects/myapp/public"
<Directory "/home/vagrant/projects/myapp/public">
AllowOverride all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName myapp.localhost.com
DocumentRoot "/home/vagrant/projects/myapp/public"
<Directory "/home/vagrant/projects/myapp/public">
AllowOverride all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName myapp.localhost.com
DocumentRoot "/home/vagrant/projects/myapp/public"
<Directory "/home/vagrant/projects/myapp/public">
AllowOverride all
</Directory>
</VirtualHost>
var gulp = require('gulp'),
concat = require('gulp-concat'),
replace = require('gulp-replace'),
uglify = require('gulp-uglify');
gulp.src(['src/**/*.js', '!src/main.conf.js', '!src/**/*_test.js'])
.pipe(replace(/'use strict';/g, ''))
.pipe(replace(/define\s?\(\[.*\],\s?function\s?\(.*\)\s?\{/g, ''))
.pipe(replace(/\}\)\;\s?$/g, ''))
.pipe(concat('app.js'))
function getAddressBulk($deal_id_arr) {
$args = func_get_args();
$cachedData = cacheRead('DealsAddressBulk', $args);
if(!empty($cachedData)) {
if($cachedData == 'empty') {
return '';
} else {
return $cachedData;
}
@fforres
fforres / gpn
Created November 13, 2015 18:36
$file = "/var/www/migroupon/app/tmp/importcsv.csv";
print_r($file);
$delimiter = empty($this->params['delimiter']) ? ";" : $this->params['delimiter'];
$enclosure = empty($this->params['enclosure']) ? '"' : $this->params['enclosure'];
$importCoupon = isset($this->params['import_coupon']);
$dealRun = true;
if (isset($this->params['dealRun'])) {
$dealRun = $this->params['dealRun'] == '1';
}