Skip to content

Instantly share code, notes, and snippets.

View ahmadshah's full-sized avatar
:octocat:
Yo!

Ahmad Shah Hafizan Hamidin ahmadshah

:octocat:
Yo!
View GitHub Profile
@ahmadshah
ahmadshah / function.php
Created February 17, 2014 14:22
WP function
//in function.php file
function getGeolocationData ($foo, $bar) {
// run wp-query here to get the data
}
// call inside template page
<?php echo getGeolocationData('var1', 'var2'); ?>
/**
* @jsx React.DOM
*/
var CampaignSliderItemComponent = React.createClass({
render: function() {
return (
<div className="slide">
<img src={this.props.image} width="688" height="242" alt="image description" />
<div className="text">
<h2>{this.props.name}</h2>
@ahmadshah
ahmadshah / gulpfile.js
Created February 3, 2014 16:07
Gulp file for SASS
var gulp, sass, watch, minifyCSS, plumber;
gulp = require('gulp');
sass = require('gulp-sass');
minifyCSS = require('gulp-minify-css');
watch = require('gulp-watch');
plumber = require('gulp-plumber');
gulp.task('compile-sass', function() {
gulp.src('./sass/*.scss')
@ahmadshah
ahmadshah / event.php
Last active January 2, 2016 09:29
Overriding current active theme in Orchestra Platform
Event::fire('foo', ['another-theme']);
Event::listen('foo', function($theme)
{
Orchestra\Theme::setTheme($theme);
});
@ahmadshah
ahmadshah / Gruntfile.js
Last active January 1, 2016 17:39
Grunt Setup
module.exports = function(grunt) {
grunt.initConfig({
shell: {
myth: {
command: function() {
return 'myth css/myth/input.css css/style.css';
},
options: {
stdout: true,
@ahmadshah
ahmadshah / laravel-builder.sh
Last active December 29, 2015 07:59
Laravel builder bash script
#!/bin/bash
echo "Laravel 4 Project Builder"
echo -n "What is the project name? "
read -e PROJECT
echo -n "Which folder will I be working on? [eg: /Users/foo/bar] "
read -e DIR