Skip to content

Instantly share code, notes, and snippets.

View matiskay's full-sized avatar

Edgar Marca matiskay

View GitHub Profile
#!/bin/bash
BOLD="\033[1m"
_BOLD="\033[22m"
RED="\033[31m"
YELLOW="\033[33m"
GREEN="\033[32m"
RESET="\033[39m"
range=$1
@matiskay
matiskay / drumod.sh
Created July 13, 2011 22:19
Create a scaffold to develop a Drupal Module
MODULENAME=$1
MACHINENAME=$2
DESCRIPTION=$3
if [[ -d $MODULENAME ]]; then
printf "There is a module with that name\n"
exit 0
fi
if [[ ! -n $MACHINENAME ]]; then
@matiskay
matiskay / zip.sh
Created July 30, 2011 16:31
Zip files that have the same name
#!/bin/bash
# Reference
# http://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash
# Description
# If you have these files
# a.x a.y a.z b.x b.y c.z
# The script zip them to
# a.zip b.zip c.zip
@matiskay
matiskay / html.sh
Created August 4, 2011 05:16
Create a scaffold to develop a html project
#!/bin/bash
PROYECTNAME=$1
function GenerateIndex {
{
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'
echo '<html>'
echo ' <head>'
echo ' <title></title>'
echo ' <link type="text/css" rel="stylesheet" href="css/reset.css" />'
@matiskay
matiskay / wp-install.sh
Created September 9, 2011 22:06
Wordpress Install
#!/bin/bash
if [[ ! -n $1 ]]; then
echo "Please insert a project name"
exit 1
fi
# Mysql Config
MYSQL_USER=""
@matiskay
matiskay / wp-snippets.php
Created September 20, 2011 20:39
Wordpress Snippets
<?php
// http://johnford.is/programmatically-pull-attachments-from-wordpress-posts/
// http://www.wprecipes.com/how-to-show-wordpress-post-attachments
// get all of the images attached to the current post
function _get_images($size = 'thumbnail') {
global $post;
$photos = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') );
@matiskay
matiskay / jsconf-eu-2011.md
Created October 7, 2011 15:20 — forked from mattpodwysocki/jsconf-eu-2011.md
JSConf.EU Slides
@matiskay
matiskay / README.txt
Created October 12, 2011 04:07
Flask Scaffold
flask.sh
Creates a scaffold to work witht flask
app.py
env/
static/
└── js
│ ├── custom.js
function setSeat(e, handler) {
e.preventDefault();
$('.selected').removeClass('selected').click(handler);
$(e.target).addClass('selected').unbind('click', handler);
$('#seatSelected').text($(e.target).data('seat'));
}
function selectFirstClass(e) {
setSeat(e, selectFirstClass);
var resulting_html = fetchFirstClassConfirm();
$.getJSON('myfile.json', function(data){
$.each(data.locations, function(i, loc) {
var myLatLng = new google.maps.LatLng(loc.lat, loc.lng);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: loc.title
//icon: loc.image,
//shadow: shadow
});