Skip to content

Instantly share code, notes, and snippets.

@cnandreu
cnandreu / uprmGradeStalker.sh
Created December 16, 2011 23:43
Bash: Get grades from home.uprm.edu
#!/bin/bash
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <carlos.andreu[at]upr.edu> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return.
# ----------------------------------------------------------------------------
#Your home.uprm.edu login goes here:

Keybase proof

I hereby claim:

  • I am cnandreu on github.
  • I am cnandreu (https://keybase.io/cnandreu) on keybase.
  • I have a public key ASCuzxRPg3pAi_2FV_tvztGNNU26xZ2cfzdkBeYzWlEOeAo

To claim this, I am signing this object:

@cnandreu
cnandreu / invokePromises.js
Created September 17, 2013 02:34
WL.Client.invokeProcedure with promises
//Code to invoke adapters using promises
var invokeAdapterWithPromises = function (adapterName, procedureName, params) {
var deferred = $.Deferred(),
invocationData = {
adapter : adapterName,
procedure : procedureName,
parameters : params
};
@cnandreu
cnandreu / main.js
Created January 14, 2014 16:17
quick jsonstore sample code
function wlCommonInit(){
//The code below must run after the deviceready event (inside wlCommonInit or after)
var collections = {
customers : {
searchFields : {
'CUSTOMERCODE' : 'string'
}
}
@cnandreu
cnandreu / fish_prompt.fish
Created June 4, 2013 07:33
~/.config/fish/functions/fish_prompt.fish
function fish_prompt
if not set -q __git_cb
set __git_cb (set_color magenta)(git branch ^/dev/null | grep \* | sed 's/* //')(set_color normal)
end
echo #space between commands
set_color yellow
printf '%s' (whoami)
@cnandreu
cnandreu / SublimeLinter.sublime-settings
Created March 25, 2013 08:45
SublimeLinter User Settings
{
"javascript_linter": "jshint",
"jshint_options": {
"regexdash": true,
"browser": true,
"devel" : true,
"jquery" : true,
"wsh": true,
"trailing": true,
@cnandreu
cnandreu / music.js
Last active December 10, 2015 12:28
var file = require('file'),
fs = require('fs'),
musicmetadata = require('musicmetadata'),
rootDir = '/Users/carlosmarx/musicfiles',
SPACE = '\n',
getMetaData = function (file, cb) {
var result = {},
parser = new musicmetadata(fs.createReadStream(file));
Host IP: 136.145.116.44
Web Server: Apache/2.2.22 (Ubuntu)
Powered-by: PHP/5.3.10-1ubuntu3.3
Keyword Found: Maraton
DB Server: MySQL >=5
Selected Column Count is 14
Valid String Column is 1
Current DB: g13
Data Base Found: information_schema
Data Base Found: g13
@cnandreu
cnandreu / README.md
Created November 27, 2012 20:39
Get youtube comments

##Install

  1. Get Node.js.
  2. Copy yt.js and package.json to your computer.
  3. Run npm install to download dependencies.
  4. chmod +x yt.js so you can execute it.

##Usage Example

@cnandreu
cnandreu / adapter-impl.js
Created September 17, 2012 04:03
Adapter parameters
/**
* WL.Server.invokeHttp(parameters) accepts the following json object as an argument:
*
* {
* // Mandatory
* method : 'get' or 'post',
* path: value,
*
* // Optional
* returnedContentType: any known mime-type or one of "json", "css", "csv", "javascript", "plain", "xml", "html"