Skip to content

Instantly share code, notes, and snippets.

View danilo04's full-sized avatar

Danilo Domínguez Pérez danilo04

View GitHub Profile
class TestActivity extends Activity {
private mFilename;
public void onCreate(Bundle paramBundle) {
Intent localIntent = getIntent();
this.mFilename = localIntent.getData().toString();
}
protected void onDestroy() {
StringBuilder localStringBuilder;
; restart before running this
dpkg --get-selections | \
grep 'linux-image*' | \
awk '{print $1}' | \
egrep -v "linux-image-$(uname -r)|linux-image-generic" | \
while read n
do
sudo apt-get -y remove $n
done
@danilo04
danilo04 / deploysoot.sh
Created September 17, 2014 15:10
Deploy Soot
#!/usr/bin/env sh
#
# author: Quentin Sabah
# modified: Danilo Dominguez Perez
#
deploy_dir=$PWD
jasmin_repo=http://github.com/Sable/jasmin.git
jasmin_branch=develop
@danilo04
danilo04 / getreactive.py
Last active August 29, 2015 14:07
Get the reactive callbacks in Android API
#!/usr/bin/python
import os
import sys
from bs4 import BeautifulSoup
from urllib2 import urlopen
import cgi
import csv
def fromurltoname(url):
@danilo04
danilo04 / reloj.php
Created April 5, 2011 03:44
Par parser
<?php
class RelojEntry {
protected $numReloj;
protected $userId;
protected $date;
public function __set($name, $value) {
$this->$name = $value;
}
<?php
/**
* $Id$
* @license
*
* @package usuarios
* @subpackage components
* @author Danilo Domínguez P.
* @copyright UTP
*/
@danilo04
danilo04 / credit_card_validation.php
Created July 3, 2013 17:15
Validacion credit card
/*
* Luhn algorithm number checker -
* (c) 2005-2008 shaman - www.planzero.org * This code has been released
* into the public domain, however please * give credit to the original author
* where possible.
*/
function _luhn_check($number) {
// Strip any non-digits (useful for credit card numbers with spaces
// and hyphens)
@danilo04
danilo04 / error_reporting.php
Created July 22, 2013 21:11
Error reporting php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
@danilo04
danilo04 / mysqlalterview.sql
Created July 23, 2013 21:48
Change the view creator mysql
SELECT CONCAT("ALTER DEFINER=`youruser`@`host` VIEW ",
table_name," AS ", view_definition,";") FROM
information_schema.views WHERE table_schema='databasename'
Mix this with the mysql command line (assuming *nix, not familiar with windows):
> echo above_query | mysql -uuser -p > alterView.sql
> mysql -uuser -ppass databasename < alterView.sql
@danilo04
danilo04 / index.php
Last active December 20, 2015 20:19
<?php
$pageIndexToSection = array(
0 => 'inicio',
1 => 'registro',
2 => 'busqueda',
3 => 'perfil',
4 => 'perfil_publico',
5 => 'agregar_evento',
6 => 'agregar_empresa',
7 => 'buscar_certificado',