Skip to content

Instantly share code, notes, and snippets.

View matiskay's full-sized avatar

Edgar Marca matiskay

View GitHub Profile
@matiskay
matiskay / widget-skeleton.php
Created December 14, 2011 19:22
Wordpress Widget Skeleton
<?php
class Widget_Name extends WP_Widget {
function Widget_Name() {
$widget_opts = array(
'classname' => 'your-awesome-class',
'description' => 'Your awesome Description',
);
@matiskay
matiskay / vocabulary_by_name.php
Created December 15, 2011 17:58
Get Vocabulary by name
<?php
/**
* This function will return a vocabulary object which matches the
* given name. Will return null if no such vocabulary exists.
*
* @param String $vocabulary_name
* This is the name of the section which is required
* @return Object
* This is the vocabulary object with the name
@matiskay
matiskay / .gitignore
Created December 16, 2011 16:43
Wordpress .gitignore
~*
._*
.DS_Store
*.sublime-project
*.sublime-workspace
wordpress/uploads/*
wordpress/uploads
*.zip
*/build*
*.
@matiskay
matiskay / README.md
Created December 16, 2011 17:30
A jQuery tab plugin

jQuery Tabs

This code is from Javascript Web Applications by Alex MacCaw

I'm modifying the code and using it as a template to make jQuery plugins.

This is nice demonstration of bind and trigger.

TODO

@matiskay
matiskay / README.md
Created December 17, 2011 00:13
A js for Google Maps v3.

A js for Google Maps v3

You can use some ideas from this code. There isn't anything fancy.

TODO

  • Refactoring
  • Make a jQuery plugin
@matiskay
matiskay / README.md
Created December 17, 2011 03:28
A basic scaffold to use hook_theme.

Basic scaffold to use hook_theme

You need to create a file called template-name.tpl.php in templates directory. Don't forget to run drush cc all, the Drupal caching system could play with your.

@matiskay
matiskay / jquery.gmaps.js
Created December 17, 2011 22:53
Google Maps and Jquery
(function($){
// Get the current latitude and longitude
var latlong = function ($lat, $lng) {
return new google.maps.LatLng($lat.val(), $lng.val());
};
// Set the position of the map
var position = function () {
return new map.set_center(latlong());
@matiskay
matiskay / app.js
Created December 20, 2011 16:35
Krpano Initial script
var viewer = createPanoViewer({swf:"filespano/krpano.swf",target:"pano"});
viewer.addVariable("xml", "awesome.xml");
viewer.addParam('bgcolor', '#006400');
viewer.addParam('wmode', 'transparent');
viewer.embed();
@matiskay
matiskay / pano.js
Created December 23, 2011 17:48
Kr Pano
<img src="thumb2.jpg" width="256" height="128" onclick="loadpano('pano2.xml');">
<script src="../../../swfkrpano.js"></script>
// <![CDATA[
embedpano({swf:"../../../krpano.swf", id:"krpanoSWFObject", xml:"pano1.xml", target:"krpanoDIV", width:"516", height:"300"});
function krpano()
{
return document.getElementById("krpanoSWFObject");
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#