Skip to content

Instantly share code, notes, and snippets.

View ralphcrisostomo's full-sized avatar

Ralf Crisostomo ralphcrisostomo

  • Goodstuff
  • Australia
View GitHub Profile
@ralphcrisostomo
ralphcrisostomo / defaults.json
Created December 19, 2013 10:53
copy defaults.json inside .grunt-init directory
{
"author_name": "Ralph Crisostomo",
"author_email": "[email protected]",
"author_url": "http://ralphcrisostomo.net/"
}
@ralphcrisostomo
ralphcrisostomo / Gruntfile.coffee
Created January 6, 2014 04:30
grunt task jasmine server
# ----------
# Jasmine Server
# ----------
grunt.registerTask 'jasmine-server', 'start web server for jasmine tests in browser', ->
grunt.task.run 'jasmine:tests:build'
grunt.event.once 'connect.tests.listening', (host,port) ->
specRunnerUrl = 'http://' + host + ':' + port + '/_SpecRunner.html'
grunt.log.writeln 'Jasmine specs available at: ' + specRunnerUrl
require('open')(specRunnerUrl)
grunt.task.run 'connect:tests:keepalive'
@ralphcrisostomo
ralphcrisostomo / modernizr-retina-test.coffee
Last active August 29, 2015 13:57
Modernizr test for retina / high resolution / high pixel densitiy
###
Modernizr test for retina / high resolution / high pixel density
@ref https://gist.github.com/joaocunha/7675924
@author Joao Cunha
@license MIT
###
Modernizr.addTest 'hires', ->
# starts with default value for modern browsers
@ralphcrisostomo
ralphcrisostomo / function.php
Last active August 29, 2015 14:01
I would have done it as following, I am sure experts here will have a better way but following is what I could come up with in hurry. First create your controller file in your theme directory (or any other if you like) with the following content. For this example the file name is korkmaz.php UPDATE 1: Please replace the previous korkmaz.php beca…
// Add a custom controller
add_filter('json_api_controllers', 'add_my_controller');
function add_my_controller($controllers) {
$controllers[] = 'Korkmaz';
return $controllers;
}
// Register the source file for our controller
add_filter('json_api_korkmaz_controller_path', 'korkmaz_controller_path');
function korkmaz_controller_path($default_path) {
@ralphcrisostomo
ralphcrisostomo / post.php
Last active December 18, 2016 02:00
Added featured_image property
<?php
// @reference: http://wordpress.org/plugins/json-api/
// @from json-api/models/post.php
class JSON_API_Post {
// Note:
// JSON_API_Post objects must be instantiated within The Loop.
@ralphcrisostomo
ralphcrisostomo / timezone.json
Created June 30, 2014 06:59
timezone gmt list json
[
[
"International Date Line West",
"GMT-11:00",
"(GMT-11:00) International Date Line West"
],
[
"Midway Island",
"GMT-11:00",
"(GMT-11:00) Midway Island"
@ralphcrisostomo
ralphcrisostomo / countries.json
Created June 30, 2014 07:04
countries json list
[
[
"Afghanistan",
"AF"
],
[
"Aland Islands",
"AX"
],
[
@ralphcrisostomo
ralphcrisostomo / timezone.json
Created June 30, 2014 11:31
timezone list json key value
[
{
"zone": "Pacific/Midway",
"gmt": "(GMT-11:00)",
"name": "Midway Island"
},
{
"zone": "US/Samoa",
"gmt": "(GMT-11:00)",
"name": "Samoa"
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store?
ehthumbs.db
@ralphcrisostomo
ralphcrisostomo / render_partial.haml
Last active August 29, 2015 14:03
Outside rails, a partial render function inside haml file.
-# --------------------
-# RENDER PARTIAL FUNCTION
-# Render function inside haml file
-# --------------------
- def render(partial) Haml::Engine.new(File.read("app/templates/#{partial}")).render end