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 / gulpfile.js
Created June 6, 2014 20:11
Gulp file
/*
* Task runner
*
*/
// Load the plugins
//
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
@jibone
jibone / .gitignore
Created November 16, 2013 18:09
My gitignore file for working on a Wordpress based projects
/*
!.gitignore
!wp-content/
wp-content/*
!wp-content/plugins/
!wp-content/themes/
wp-content/plugins/*
!wp-content/plugins/[plugin name]/
@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": "*",
@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 / 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 / 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 / numberCommas.coffee
Created April 17, 2013 08:35
add commas to long numbers.
numberCommas = (x) ->
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
<?php
$arr[date ('j',strtotime($row2['date_start']))] = array();
array_push($arr[date ('j',strtotime($row2['date_start']))], $row2['event']);
?>
$class = "link-class";
$evenid = "20";
$html = '
<tr>
<td>
<a href="#" class="%s" id="%s">Test</a>
</td>
<td>
<p>something</p>
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