Skip to content

Instantly share code, notes, and snippets.

View ghalimi's full-sized avatar

Ismael Ghalimi ghalimi

View GitHub Profile
@ghalimi
ghalimi / HEX2BIN.js
Last active August 7, 2016 17:29
HEX2BIN Function
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function HEX2BIN(number, places) {
// Return error if number is not hexadecimal or contains more than ten characters (10 digits)
if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) return '#NUM!';
// Check if number is negative
var negative = (number.length === 10 && number.substring(0, 1).toLowerCase() === 'f') ? true : false;
// Convert hexadecimal number to decimal
{
"stc_schema": {
"title": "Controller Schema",
"type": "object",
"properties": {
"stc_model": {
"stc_datatype": "stc_json",
"stc_name": "Model",
"stc_description": "Model of the page.",
"stc_required": false,
{
"copyright": "© Sutoiku, Inc. 2013",
"stc_type": "stc_levels",
"stc_summaries": "stc_numerical",
"stc_id_expression": "MOMENTUTC(group, 'YYYY-MM-DD[T]HH:mm:ss+00:00')",
"stc_add_expression": "MOMENTUTCADD(start, period, number)",
"stc_diff_expression": "MOMENTUTCDIFF(start, end, period)",
"stc_format_expression": "MOMENTUTC(group)",
"stc_casting_expression": "MOMENT(value, 'X')",
"stc_inverse_expression": "MOMENT(value * 1000, 'YYYY-MM-DD[T]HH:mm:ss+00:00')",
{
"stc_schema": {
"copyright": "© Sutoiku, Inc. 2013",
"title": "JSON Schema Schema",
"type": "object",
"properties": {
"copyright": {
"stc_datatype": "stc_string",
"stc_name": "Copyright",
"stc_description": "Copyright of the JSON Schema.",
@ghalimi
ghalimi / twitter.json
Created September 14, 2013 23:37
Twitter Bindings
[
{
"copyright": "© Sutoiku, Inc. 2013",
"stc_name": "Twitter Get Status By Id",
"stc_identifier": "stc_twitter_get_status_by_id",
"stc_source_api": {
"stc_name": "GET statuses/show/: id",
"stc_website": "https: //dev.twitter.com/docs/api/1.1/get/statuses/show/%3Aid",
"stc_immutable": false,
"stc_refreshed": true,
{
"stc_schema": {
"title": "Family Definition Schema",
"type": "object",
"properties": {
"stc_type": {
"stc_datatype": "stc_category",
"stc_name": "Type",
"stc_description": "Type of the family.",
"stc_required": true,
{
"copyright": "© Sutoiku, Inc. 2013",
"stc_schema": {
"title": "Chart Definition Schema",
"type": "object",
"properties": {
"dimensions": {
"type": "array",
"stc_name": "Dimensions",
"stc_description": "Dimensions of the chart.",
@ghalimi
ghalimi / form.json
Last active December 22, 2015 23:09
Form Definition Schema
{
"copyright": "© Sutoiku, Inc. 2013",
"stc_schema": {
"title": "Form Definition Schema",
"type": "object",
"properties": {
"stc_default_tab": {
"stc_datatype": "stc_identifier",
"stc_name": "Default tab",
"stc_description": "Default tab displayed by the form.",
@ghalimi
ghalimi / relationship.json
Last active December 22, 2015 14:38
Relationship Options Schema
{
"copyright": "© Sutoiku, Inc. 2013",
"title": "Relationship Options Schema",
"type": "object",
"properties": {
"stc_target_object": {
"stc_datatype": "stc_relationship",
"stc_name": "Target object",
"stc_description": "Target objet for the relationship.",
"stc_required": true,
@ghalimi
ghalimi / category.json
Last active December 22, 2015 14:38
Category Options Schema
{
"copyright": "© Sutoiku, Inc. 2013",
"title": "Category Options Schema",
"type": "object",
"properties": {
"stc_categories": {
"stc_datatype": "stc_json",
"stc_name": "Categories",
"stc_description": "Set of categories defined by the field.",
"stc_required": true,