This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* A usage example for the livestats project pushing data | |
* to a Ducksboard dashboard. | |
* | |
* https://github.com/ssaunier/livestats | |
* https://ducksboard.jira.com/wiki/display/API/API+Reference | |
* | |
* Copyright 2011, Sébastien Saunier <[email protected]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
if [ $# -eq 0 ]; then | |
echo "Usage: ./generate_api_controller.sh CONTROLLER" | |
exit 1 | |
fi | |
bundle exec rails generate controller "api/v1/$1" --no_helper --no_assets | |
rm -rf app/views/api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DS_Store | |
.sass-cache | |
public/images/stickers-retina-s28fb90c6bd.png | |
public/images/stickers-s8db04c2c8a.png | |
public/stylesheets/application.css |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Symbolizer | |
def self.deep_symbolize(object) | |
if object.kind_of? Hash | |
object.keys.each do |k| | |
object[k == "_id" ? :id : k.to_sym] = self.deep_symbolize(object.delete k) | |
end | |
object | |
elsif object.kind_of? Array | |
object.map { |e| self.deep_symbolize e } | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result.html | |
Gemfile.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_spec(file) | |
unless File.exist?(file) | |
puts "#{file} does not exist, no specs to run." | |
return | |
end | |
puts "Running #{file}" | |
system "bundle exec rspec #{file} --drb --colour" | |
puts | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright Applidget - 2013 | |
# Author : Sébastien Saunier (@ssaunier) | |
# Released under MIT License | |
require "httparty" | |
class Zoho | |
include HTTParty | |
base_uri 'invoice.zoho.com:443/api' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copyright Sébastien Saunier (@ssaunier) - 2013 | |
# License: MIT | |
# | |
# Script to run at the root of an apache folder where you want to deploy with git. | |
# It will create a repository where you can push, and set up a post-receive script | |
# with is run each time this server gets pushed a new version: | |
# | |
# 1. post-receive compute the new version number based on existing ones | |
# in the $DEPLOYMENT_TARGET_ROOT folder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright: Applidget - 2013 | |
# License: MIT | |
# Author: Sébastien Saunier (@ssaunier) | |
# | |
# Create regex patterns insensitive to accented characters | |
# Useful when querying a name in MongoDB | |
# Mapping array source: http://stackoverflow.com/a/228006/197944, with a .gsub("\\x", "\\u00") | |
class RegexpExtension |
OlderNewer