Skip to content

Instantly share code, notes, and snippets.

View evervasquez's full-sized avatar

EveR Vásquez evervasquez

View GitHub Profile
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
#include <Servo.h>
Servo esc1;
Servo esc2;
Servo esc3;
Servo esc4;
int speedvalue;
int arm = 1000;
int steady = 300;
<?php
/**
* Render chart's JavaScript code.
*
* @return string Generated JavaScript code.
*/
public function renderJavaScript() {
$js = '$(function() {';
$js .= sprintf(
//código para buscar imagen en la galeria
private static int SELECT_PICTURE = 2;
private int code;
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
code = SELECT_PICTURE;
startActivityForResult(intent, code);
@evervasquez
evervasquez / gist:3999b0287272bc24e5a6
Created November 26, 2014 04:12
get images and documents
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home: // ID del boton
finish(); // con finish terminamos el activity actual, con lo que volvemos
// al activity anterior (si el anterior no ha sido cerrado)
return true;
case R.id.action_send:
Toast.makeText(getApplicationContext(), "send", Toast.LENGTH_SHORT).show();
return true;
@evervasquez
evervasquez / Path
Created December 27, 2014 20:21
Clase que me permite recuperar el Path
package utils;
import android.annotation.TargetApi;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import java.util.Arrays;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import com.facebook.Request;
import com.facebook.Response;
@evervasquez
evervasquez / config.js
Created March 19, 2015 17:05
config-evervasquez.me
production: {
//url de tu blog http://example.herokuapp.com
url: 'http://evervasquezblog.herokuapp.com',
//configuración de email
mail: {},
//configuración de base de datos
database: {
client: 'postgres', //cliente de gestor de base de datos
@evervasquez
evervasquez / gunicorn_start
Created September 29, 2015 16:20
vagrant-debian-jessie-mac gunicorn_start
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/var/www/html/hello_django/hello # Django project directory
SOCKFILE=/var/www/html/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@evervasquez
evervasquez / hello.conf
Created September 29, 2015 16:30
vagrant-debian-jessie supervizor
[program:hello]
command = /var/www/html/hello_django/virtual/bin/gunicorn_start ; Command to start app
user = hello ; User to run as
stdout_logfile = /webapps/hello_django/logs/gunicorn_supervisor.log ; Where to write log messages
redirect_stderr = true ; Save stderr in the same log
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 ; Set UTF-8 as default encoding