Skip to content

Instantly share code, notes, and snippets.

View sworup's full-sized avatar
🦖
Normal

Sworup Shakya sworup

🦖
Normal
View GitHub Profile
@jamierumbelow
jamierumbelow / customer.php
Created October 1, 2011 09:55
A simple concept for basic JOIN/relationship support in MY_Model
<?php
class Customer extends MY_Model {
protected $relations = array(
'addresses' => array(
'join_on' => 'addressable_id',
'where' => array('addresses.addressable_type' => 'customers')
)
);
}
@jamierumbelow
jamierumbelow / currencies.json
Created January 5, 2012 11:34
A simple currency helper for PHP. Includes clever display and currency conversion.
{
"aed": {
"priority": 100,
"iso_code": "AED",
"name": "United Arab Emirates Dirham",
"symbol": "د.إ",
"subunit": "Fils",
"subunit_to_unit": 100,
"symbol_first": true,
"html_entity": "",
@webaware
webaware / gist:3830445
Created October 3, 2012 23:01
Example of simple widget for WP Flexible Map plugin
<?php
// drop this code into your theme's functions.php file and edit the array properties below
add_action('widgets_init', 'widgetsInitExampleMap');
function widgetsInitExampleMap() {
register_widget('ExampleMapWidget');
}
@accentinteractive
accentinteractive / dump_helper.php
Created October 5, 2012 07:09
dump_helper: functions to dump variables to the screen, in a nicley formatted manner
<?php
/**
* Dump helper. Functions to dump variables to the screen, in a nicley formatted manner.
* @author Joost van Veen
* @version 1.0
*/
if (!function_exists('dump')) {
function dump ($var, $label = 'Dump', $echo = TRUE)
{
// Store dump in variable
@saniko
saniko / app.js file
Created October 11, 2012 16:59
a very simple bootstrap boilerplate for building backbone.marionette based on require.js
define([
'jquery',
'underscore',
'backbone',
'marionette',
'handlebars',
'text!templates/app_view.html',
'modules/mainMenuView/mainMenuView',
@jamierumbelow
jamierumbelow / search_model.php
Created April 10, 2013 22:02
A quick multi-table multi-field search model for CI / PHP
<?php
class Search_model extends CI_Model
{
protected $tables = array(
'users' => array( 'name', 'email' )
);
public function run($search)
{
@jgoux
jgoux / app.js
Created April 15, 2014 14:53
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@adrianorsouza
adrianorsouza / sublime-command-line.md
Last active September 26, 2023 16:26
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git