Skip to content

Instantly share code, notes, and snippets.

View infacq's full-sized avatar

Muhaimin infacq

  • Seri Kembangan, Selangor Malaysia
View GitHub Profile
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@jonathonbyrdziak
jonathonbyrdziak / Instructions
Created October 10, 2011 08:02
The perfect magento installation on CentOS 6
#
# @author Jonathon byrd
#
############################################################
# first things first, set your iptables for a web server. If you jack these
# up you don't want to have to re-install your os after doing much more.
# @see http://www.thegeekstuff.com/2011/06/iptables-rules-examples/
# and
# @see https://help.ubuntu.com/community/IptablesHowTo
<button id='stop'>stop</button>
<button id='start'>start</button>
<div id='count'></div>
<div id="shell">
</div>
<script
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyA_OZRpMaskOiOyodu5PQSbFKrY5hjFRxY&sensor=false"></script>
<script>
var mapMarkup = '<div id="map" style="width: 200px; height: 200px;">loading</div>';
@mxriverlynn
mxriverlynn / 1.html
Created April 11, 2012 14:37
modal dialog with backbone
<script id="modal-view-template" type="text/html">
<div class="modal-header">
<h2>This is a modal!</h2>
</div>
<div class="modal-body">
<p>With some content in it!</p>
</div>
<div class="modal-footer">
<button class="btn">cancel</button>
<button class="btn-default">Ok</button>
@btd
btd / jQuery.print.js
Created April 15, 2012 07:25
jQuery.print.js
// Create a jquery plugin that prints the given element.
jQuery.fn.print = function(){
// NOTE: We are trimming the jQuery collection down to the
// first element in the collection.
if (this.size() > 1){
this.eq( 0 ).print();
return;
} else if (!this.size()){
return;
}
@mxriverlynn
mxriverlynn / 1.js
Created April 25, 2012 12:56
view helpers for underscore
var data = {
type: "something",
name: "whatever",
addresses: [
{
type: "read_address",
address: "1/2/3",
value: "10"
},
{
@bruth
bruth / README.md
Created April 27, 2012 00:51
sortedGroupBy using Underscore

sortedGroupBy

jsFiddle Example

Convenience function for performing a groupBy on a list then a sortBy on the resulting groups using Underscore methods.

sortedGroupBy(list, groupByIterator, sortByIterator)
@insaciableslabs
insaciableslabs / 1.html
Created August 28, 2013 17:55 — forked from mxriverlynn/1.html
Adaptation of Derick Bayley Notification Region to be used with Twitter Bootstrap and Backbone 1.0
<script id="modal-view-template" type="text/html">
<div class="modal-header">
<h2>This is a modal!</h2>
</div>
<div class="modal-body">
<p>With some content in it!</p>
</div>
<div class="modal-footer">
<button class="btn">cancel</button>
<button class="btn-default">Ok</button>
@jardix22
jardix22 / 1.html
Last active March 6, 2017 16:09 — forked from mxriverlynn/1.html
Modal Bootstrap 3 + Marionette.js
<script id="modal-view-template" type="text/html">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
@nedga055
nedga055 / example-usage.js
Last active March 25, 2016 14:37
Backbone Marionette View and Template for file uploads using Plupload. Requires Plupload (http://www.plupload.com/).
// Add this to the onRender() of the view you want to add your file upload to
// The options passed in will override the default Plupload options
// (http://www.plupload.com/documentation.php)
this.fileUploadView = new FileUploadView({
el: '#upload-container',
url: 'upload.php',
successMessage: 'Your file uploaded successfully.'
});
this.fileUploadView.render();