Skip to content

Instantly share code, notes, and snippets.

View ajsb85's full-sized avatar
👨‍💻
Every day is a brand new day

Alexander Salas Bastidas ajsb85

👨‍💻
Every day is a brand new day
View GitHub Profile
@ajsb85
ajsb85 / jpbutton.js
Created October 22, 2011 05:27 — forked from bogomil/jpbutton.js
Mozilla JetPack example - create a button on page
var buttonScript = [
'var butt = document.createElement("button");', //define button element
'var btext = document.createTextNode("Click me");', //define the text
'butt.appendChild(btext);', //attach text to the button
'butt.addEventListener("click", function(){document.bgColor="red"} , false)', //handle onclick event
'document.getElementById("test").appendChild(butt);', //put the button on the page
];
var pageButton = require("page-mod").PageMod({
@ajsb85
ajsb85 / Error Touchscreen Controllers
Created November 9, 2012 17:27
Error Touchscreen Controllers from Atmel
I/EventHub( 146): New device: id=3, fd=118, path='/dev/input/event1', name='atmel-maxtouch', classes=0x14,
configuration='/system/usr/idc/atmel-maxtouch.idc', keyLayout='', keyCharacterMap='', builtinKeyboard=false
I/InputReader( 146): Touch device 'atmel-maxtouch' could not query the properties of its associated display 0. The device
will be inoperable until the display size becomes available.
I/InputReader( 146): Device added: id=3, name='atmel-maxtouch', sources=0x00001002
I/InputReader( 146): Device added: id=2, name='gpio-keys', sources=0x00000101
I/InputReader( 146): Device added: id=1, name='tegra Wired Accessory Jack', sources=0x80000000
I/InputReader( 146): Reconfiguring input devices. changes=0x00000004
I/InputReader( 146): Device reconfigured: id=3, name='atmel-maxtouch', surface size is now 1280x800, mode is 1
@ajsb85
ajsb85 / GPL.md
Created March 10, 2013 00:20 — forked from jnrbsn/GPL.md

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

@ajsb85
ajsb85 / index.js
Created November 18, 2013 12:56 — forked from sethvincent/index.js
requirebin sketch
var inherits = require('inherits');
var Game = require('crtrdg-gameloop');
var Entity = require('crtrdg-entity');
var Keyboard = require('crtrdg-keyboard');
var canvas = document.createElement('canvas');
canvas.id = 'game';
var body = document.getElementsByTagName('body')[0];
@ajsb85
ajsb85 / adb-shell-pm.sh
Last active August 29, 2015 13:57 — forked from davidnunez/gist:1404789
List all installed packages in android adb shell
pm list packages -f
adb shell "pm list packages -f" > packages.txt
#____________________________________________________
#http://developer.android.com/tools/help/adb.html#pm
# ANDROID / ECLIPSE
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
@ajsb85
ajsb85 / slides.md
Created April 2, 2014 20:35 — forked from alunny/slides.md
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
progress: function() { console.log("standard progress callback"); },
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function") {
req.addEventListener("progress", function(evt) {
that.progress(evt);
<?php
ignore_user_abort(true);
function syscall ($cmd, $cwd) {
$descriptorspec = array(
1 => array('pipe', 'w'), // stdout is a pipe that the child will write to
2 => array('pipe', 'w') // stderr
function stripAccents(str) {
var reAccents = /[àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ]/g;
var replacements = 'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY';
return str.replace(reAccents, function (match) {
return replacements[reAccents.source.indexOf(match)];
});
};