Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🎯
Focusing

Jose Palala jpalala

🎯
Focusing
View GitHub Profile
@jpalala
jpalala / filerscan.php
Created July 18, 2012 06:20
PHP scan files inside current directory
<?php
print_r(scandir(getcwd()));
?>
@jpalala
jpalala / httpd.conf
Created July 23, 2012 09:39
my fedora httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@jpalala
jpalala / var_dump_.js
Created July 27, 2012 07:22
javascript dumping contents of a javascript variable or object file
var MAX_DUMP_DEPTH = 10;
function dumpObj(obj, name, indent, depth) {
if (depth > MAX_DUMP_DEPTH) {
return indent + name + ": <Maximum Depth Reached>\n";
@jpalala
jpalala / ahahlib.js
Created August 2, 2012 06:05
ajax ahah library error
function ahah(url, target) {
document.getElementById(target).innerHTML = ' Fetching data...';
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
if (req != undefined) {
req.onreadystatechange = function() {ahahDone(url, target);};
req.open("GET", url, true);
@jpalala
jpalala / createdir.sh
Created September 16, 2012 14:22
Creates a directory with a public ownership
#!/bin/bash
if [ "$1" != "" ]
then
sudo mkdir $1
sudo chmod 777 $1
fi
@jpalala
jpalala / tint2rc
Created September 17, 2012 23:43
my openbox ubuntu tint2rc
# Tint2 config file
# Generated by tintwizard (http://code.google.com/p/tintwizard/)
# For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure
# Background definitions
# ID 1
rounded = 7
border_width = 2
background_color = #000000 60
border_color = #FFFFFF 16
@jpalala
jpalala / gist:3754048
Created September 20, 2012 04:57 — forked from six519/gist:3634045
Split Words
<?php
function splitWords($paragraph, $numberOfWords) {
$returnArray = array();
$splittedString = explode(" ", $paragraph);
$counter = 0;
$counter2 = 0;
for($x = 0; $x < count($splittedString); $x++) {
@jpalala
jpalala / checkchecked.js
Created September 20, 2012 05:01
check checked checkboxes using jquery
$(".parentCheckBox").click(function(){
$(".childCheckBox").attr("checked",$(this).attr("checked") || false);
});
@jpalala
jpalala / nodejs.ubuntu.md
Created September 22, 2012 07:16
node installation notes on ubuntu
@jpalala
jpalala / yeoman.install.md
Created October 1, 2012 11:58
installing yeoman on ubuntu - tips from a guy who tried installing

YEOMAN!

What's up?

Okay so the basics is you have to install compass, which needs ruby,rubygems and also install nodeJS, which means pulling it off from the repository of node (and configuring, making, make-installing).

We could use rvm to install ruby, but that's not necessary unless you plan to also try out different ruby versions and different ruby gems (to see what works).

Caveat