Skip to content

Instantly share code, notes, and snippets.

View jibone's full-sized avatar
🧑‍💻
Locked In

J Shamsul Bahri jibone

🧑‍💻
Locked In
View GitHub Profile
@jibone
jibone / gist:4466010
Created January 6, 2013 08:15
rvm the latest Ruby on MacOSX
rvm install ruby-1.9.3-p362 --with-gcc=clang
@jibone
jibone / exp.php
Last active December 12, 2015 05:18
// I don't think this works...
echo "<td><div class='days'><span>". ($v.if(isset($arr[$v])) { echo $arr[$v]; }) . "</span></div></td>"
// Try this instead....
if(isset($arr[$v])) {
echo "<td><div class='days'><span>". $v.$arr[$v]; . "</span></div></td>"
} else {
before_filter :authenticate_admin, :except => [:login, :login_verify]
before_filter :save_login_state_admin, :only => [:login, :login_verify]
def login
# login form
end
def login_verify
authorized_admin = Admin.authenticate(params[:admin_username], params[:admin_password])
if authorized_admin
$class = "link-class";
$evenid = "20";
$html = '
<tr>
<td>
<a href="#" class="%s" id="%s">Test</a>
</td>
<td>
<p>something</p>
<?php
$arr[date ('j',strtotime($row2['date_start']))] = array();
array_push($arr[date ('j',strtotime($row2['date_start']))], $row2['event']);
?>
@jibone
jibone / numberCommas.coffee
Created April 17, 2013 08:35
add commas to long numbers.
numberCommas = (x) ->
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
@jibone
jibone / compactObject.coffee
Created April 17, 2013 08:36
Underscore.js mixin to compact object.
_.mixin compactObject: (object) ->
_.each object, (v, k) ->
delete object[k] unless v
object
@jibone
jibone / promo.json
Created May 28, 2013 07:01
footer promo example
{
"promos": [
{
"name": "promo1",
"url": "/promo1",
"image": "/img/promos/promo1.jpg"
},{
"name": "promo2",
"url": "/promo2",
"image": "/img/promos/promo4.jpg"
@jibone
jibone / Cakefile
Last active December 20, 2015 06:39
The current cake file I'm using at the moment.
###
#
# Build Script
# Compiles Sass and Coffee files to CSS and JavaScript
#
###
# ------------------------------------------------------
# -- Load dependencies ---------------------------------
fs = require "fs"
@jibone
jibone / composer.json
Created August 12, 2013 04:50
My generic composer file for a PHP project.
{
"require": {
"php": ">=5.3.1",
"behat/behat": "2.4.*@stable",
"behat/mink": "1.4@stable",
"behat/mink-extension": "*",
"behat/mink-goutte-driver": "*",
"behat/mink-sahi-driver": "*",
"behat/mink-selenium-driver": "*",
"behat/mink-selenium2-driver": "*",