Skip to content

Instantly share code, notes, and snippets.

View josue's full-sized avatar
:shipit:
Crushing it from 1999 to Present

Josué Rodriguez josue

:shipit:
Crushing it from 1999 to Present
View GitHub Profile
CmdUtils.CreateCommand({
names: ["php"],
icon: "http://static.php.net/www.php.net/favicon.ico",
description: "Check PHP function specs and comments. (v0.4)",
help: "PHP",
author: {name: "Josue Rodriguez", email: "[email protected]"},
license: "MIT",
homepage: "http://josuerodriguez.com",
arguments: [
{role: "object", label: 'function', nountype: noun_arb_text}
#!/bin/bash
# ========== Your Server Config ==========
# your SSH credentials ...
SSH_User="user"
SSH_Host="server.com"
# directory where the tar.gz file will be uploaded then extracted from.
# recommened it be root directory so when you untar it falls nicely into place...
WWW_Dir="html/"
#!/bin/bash
# Author: Josue Rodriguez (@JosueR)
# Grabs the current pwd via Git repo then performs a php syntax on all php files.
me="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
Git_Root=$(readlink -f ./$(git rev-parse --show-cdup))
option=$1
files_found=0
counter=0
#!/bin/bash
# file: tweet
# NOTE: make sure to put this file in '/usr/bin' and make it executable: sudo chmod +x /usr/bin/tweet
# usage: tweet "hello from CLI"
user="USERNAME"
pass="PASSWORD"
tweet=$1
@josue
josue / mysqlclearcache
Created October 20, 2010 07:46
MySQL clear query cache via commandline
#!/bin/bash
# Created by: Josue Rodriguez <[email protected]> (c) 2010.
# Clear MySQL Cache
# Download file into directory "/usr/bin" then run "sudo chmod +x /usr/bin/mysqlclearcache"
mysql_options=$1
if [ "$mysql_options" == "--help" ]; then
@josue
josue / ToJSON.js
Created December 12, 2010 08:02
Converts javascript strings to simple JSON.
String.prototype.trim = function() { return this.toString().replace(/^\s+/,'').replace(/\s+$/,''); };
String.prototype.ToJSON = function() {
var quotes = function(s) { return (s||'').toString().replace(/^"/,'').replace(/"$/,'').replace(/^'/,'').replace(/'$/,'').trim(); };
var commas = function() {
this.change = function(s){
var s = (s||'').toString();
if(/.*:.*/.test(s) && /('.*,.*')/.test(s)) {
var x = s.match(/('.*,.*')/)[1] || ''; var orig = x; var n = x.match(/,/g).length;
for(i=1; i<=n; i++) {
@josue
josue / jquery.dummyimage.js
Created December 31, 2010 01:09
Display dynamic generated dummy image / placeholders.
$(function(){
// jQuery - DummyImage
// Josue Rodriguez (c) 2010-12-30, MIT License
$.fn.dummyImage = (function(options) {
var opt = {
'class' : 'dummyImage',
'display' : 'inline-block',
'position' : 'relative',
@josue
josue / global.js
Created April 30, 2011 23:50
Common Javascript boot and usable methods for practical application development.
/* ===========================================================================
Copyright (c) 2011 - Josue Rodriguez <[email protected]>
Permission is hereby granted, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, and/or distribute copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@josue
josue / jquery.opengraph.js
Created June 30, 2011 20:41
Collects OpenGraph tag data from markup into an object list.
/*
* Author: Josue Rodriguez <[email protected]>
* Created: 2011-06-30
* License: MIT
* Description: Collects OpenGraph tag data from markup into an object list.
*/
var OpenGraph = function(opts){
var opt = opts || {};
var context = opt.DOM || typeof opts==="string" && opts || document;
@josue
josue / getInputs.js
Created November 18, 2011 22:03
getInputs - collects and serialize all tag fields (input,textarea,select) into jQuery object or JSON format.
// prerequisites: jQuery library.
getInputs = function(t,f){
var opt = typeof t==="object" && t || {};
var target = opt.target || (t===jQuery || typeof t==="string") && t;
var filter = opt.filter || f;
var A = {
serialized: {},
fields: $("input,textarea,select", target || document)
};