Skip to content

Instantly share code, notes, and snippets.

View demogar's full-sized avatar
👋

Demostenes Garcia G. demogar

👋
View GitHub Profile
@demogar
demogar / chain_js.js
Created April 28, 2011 18:33
chain js javascript
$(document).ready(function() {
var array = [
{first:'Isaac', last:'Newton', id: '1'},
{first:'Johannes', last:'Keppler', id:'2'},
{first:'Alessandro', last:'Volta', id: '3'},
{first:'Blaise', last:'Pascal', id: '4'}
];
$('#persons')
.items(array)
@demogar
demogar / test.html
Created June 8, 2011 16:53
responsive design con adapt.js
<script>
// Responsive design with adapt.js
function resize_callback(i, width) {
if (i > -1) {
if (i == 0)
$("body").removeClass().addClass("mobile");
else if (i == 1)
$("body").removeClass().addClass("tablet");
else if (i == 2 || i == 3)
$("body").removeClass().addClass("regular");
my_ssp.addEventListener(SSPDataEvent.ALBUM_DATA, onSlideShowData);
function onSlideShowData(event:SSPDataEvent)
{
if (event.type == "albumData")
{
ExternalInterface.call("start_spp_navigation", event.data.totalImages);
}
}
import flash.external.*;
import net.slideshowpro.slideshowpro.*;
// On data load, get number of images
my_ssp.addEventListener(SSPDataEvent.ALBUM_DATA, onSlideShowData);
function onSlideShowData(event:SSPDataEvent)
{
if (event.type == "albumData")
{
ExternalInterface.call("start_spp_navigation", event.data.totalImages);
(function($){
$.fn.sspnavigation = function(options) {
// Setting up the default data
var defaults = {
qtyImages: 0,
childDelimiterStart: "<li>",
childDelimiterEnd: "</li>"
};
// Using defaults
function start_spp_navigation(totalImages) {
$("#spp_elements").sspnavigation({
qtyImages: totalImages
});
}
@demogar
demogar / MY_Controller.php
Created August 9, 2011 04:45
Archivo de configuracion para las rutas con seguridad
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
class MY_Controller extends CI_Controller
{
function __construct()
{
parent::__construct();
if (in_array($this->uri->segment(1), $this->config->item('ssl_pages'))) {
force_ssl();
@demogar
demogar / Pgcache.php
Created October 4, 2011 15:59
Pgache
<?php
/**
* Pgcache is a library used for caching elements using the built-in cache driver
*
* @author Demostenes Garcia <me@demogar.com>
*/
class Pgcache
{
@demogar
demogar / Ruby.sublime-settings
Created December 2, 2011 23:48
Ruby.sublime-settings
{
"extensions":
[
"rb",
"ru",
"Gemfile",
"Rakefile"
],
"rulers":
[
@demogar
demogar / Base File.sublime-settings
Created December 9, 2011 16:51
Base File.sublime-settings
{
"theme": "Soda Light.sublime-theme",
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"fallback_encoding": "UTF-8",
"font_options":
[
"subpixel_antialias"
],
"detect_indentation": false,
"word_wrap": false,