Skip to content

Instantly share code, notes, and snippets.

View djnet00's full-sized avatar

Julián Mesa djnet00

View GitHub Profile
@djnet00
djnet00 / gist:2707577
Created May 16, 2012 05:00
MySql2 gem on lion with homebrew
brew install mysql
env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-dir=/usr/local/Cellar/mysql/5.5.19 --with-mysql-lib=/usr/local/Cellar/mysql/5.5.19/lib --with-mysql-include=/usr/local/Cellar/mysql/5.5.19/include --with-mysql-config=/usr/local/Cellar/mysql/5.5.19/bin/mysql_config
@djnet00
djnet00 / phonegap_download_example.html
Created July 4, 2012 15:23 — forked from nathanpc/phonegap_download_example.html
Sample code to download file from internet - Phonegap Wiki
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Android
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta charset="utf-8">-->
<!-- iPad/iPhone specific css below, add after your main css >
@djnet00
djnet00 / custom.js
Created February 19, 2013 19:43 — forked from drewjoh/custom.js
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array(
'image' => 'image',
);
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript" src="lib/android/cordova-1.7.0.js"></script>
<script type="text/javascript">
window.appRootDirName = "download_test";
document.addEventListener("deviceready", onDeviceReady, false);
$.extend $.fn.datepicker.defaults,
format: 'yyyy-mm-dd'
weekStart: 1
###
<input type="text" id="from" class="datepicker" data-dependent="to" data-diff="7" />
<input type="text" id="to" class="datepicker" />
###
$("input.date").each ->
@djnet00
djnet00 / gist:7349901
Created November 7, 2013 06:18
Workaround for buggy footer fixed position when virtual keyboard is on/off
// Workaround for buggy footer fixed position when virtual keyboard is on/off
$(document).on('touchstart focus','input, textarea', function (e) {
$('footer, .float-buttons').css('display', 'none');
})
.on('blur','input, textarea', function (e) {
$('footer, .float-buttons').css('display', 'block');
});
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated with https://github.com/barryvdh/laravel-ide-helper
* Updated for Laravel 4.1.8 (2013-12-13)
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
exit('Only to be used as an helper for your IDE');
<?php
class MatchesControllerTest extends TestCase
{
protected $user;
protected $profile;
public function setUp()
{
parent::setUp();
DB::beginTransaction();
try {
DB::connection()->getPdo()->beginTransaction();
// database queries here
DB::connection()->getPdo()->commit();
} catch (\PDOException $e) {
// Woopsy
DB::connection()->getPdo()->rollBack();
}