Skip to content

Instantly share code, notes, and snippets.

View giobyte8's full-sized avatar

Giovanni Aguirre giobyte8

View GitHub Profile
@giobyte8
giobyte8 / Sincronizador.java
Created December 2, 2014 19:50
Metodos para manipular archivos, comparar y sincronizar dos directorios
package sincronizador;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import javax.swing.JOptionPane;
@giobyte8
giobyte8 / sp
Created December 18, 2018 05:38 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@giobyte8
giobyte8 / queryParamReader.js
Created August 23, 2018 03:38
Read query param from javascript
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
@giobyte8
giobyte8 / ESP8266.sh
Created October 22, 2017 03:22
Basic AT commands for ESP8266
# Ping message
AT
# Change BAUD range
AT+CIOBAUD=9600
# Check SDK version
AT+GMR
@giobyte8
giobyte8 / primer.cpp
Last active May 28, 2017 22:43
A C++ program to determinate prime numbers
#include <iostream>
using namespace std;
int main() {
int n;
// Solicita al usuario el número de primos deseados
cout << "¿Cuántos números primos desea calcular? ";
cin >> n;
@giobyte8
giobyte8 / vimrc
Last active November 12, 2016 06:52
My personal .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
@giobyte8
giobyte8 / behaviorsYii2.php
Last active February 11, 2016 18:39
Autentication example
<?php
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
array( // Logged users (Admin & Capturista)
'actions' => [
'index',
@giobyte8
giobyte8 / simpleLogin.html
Last active January 3, 2016 01:49
Este gist muestra como utilizar el API de Microsoft Skydrive para hacer login con la cuenta de algún usuario. El código es para fines de aprendizaje, posiblemente en un ambiente de producción se requieran algunas validaciones adicionales.
<!--
La siguiente pagina, muestra de manera sencilla como permitir al usuario hacer login
mediante su cuenta Microsoft a traves del API de Microsoft Live.
-@author: Aguirre Alvarez J Giovanni.
-Created on: January, 12 from 2014.
-->
<!DOCTYPE html>
<html>
<head>
@giobyte8
giobyte8 / gulpfile.js
Last active October 7, 2015 17:01 — forked from wesbos/gulpfile.js
FAST Browserify + Reactify + Babelify
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var babelify = require('babelify');
var watchify = require('watchify');
var notify = require('gulp-notify');
@giobyte8
giobyte8 / nsenter-compile-dockerized.sh
Last active September 10, 2015 02:15 — forked from mbn18/gist:0d6ff5cb217c36419661
How to install nsenter on Ubuntu 14.04
# Ubuntu 14.04 don't have nsenter - the straight forward way required me to install build tools and etc.
# I preferred to keep the system clean and install nsenter in a container and then copy the command to the host
# Note - its also possible to run nsenter from a container (didn't tried) https://github.com/jpetazzo/nsenter
# start a container
docker run --name nsenter -it ubuntu:14.04 bash
## in the docker
apt-get update
apt-get install git build-essential libncurses5-dev libslang2-dev gettext zlib1g-dev libselinux1-dev debhelper lsb-release pkg-config po-debconf autoconf automake autopoint libtool