This file contains 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
namespace :json do | |
# Usage: rake json:set_fields[file_name] | |
desc "Set some sample fields to an existing JSON file" | |
task :set_fields, [:file_name] => :environment do |t, args| | |
file_name = args[:file_name] | |
file_folder = Rails.root.join('app','assets','sample') # Step over the right folder | |
file = File.read(file_folder.join(file_name + ".json")) # Get the JSON file | |
fields = JSON.parse(form) # Get the JSON data to parse | |
updated_fields = set_fields(fields) # Set required to ruby Hash |
This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<!-- when using the mode "code", it's important to specify charset utf-8 --> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<link href="jsoneditor/jsoneditor.css" rel="stylesheet" type="text/css"> | |
<script src="jsoneditor/jsoneditor.min.js"></script> | |
</head> |
This file contains 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
{ | |
"manifest_version": 2, | |
"name": "Instant JSON Editor", | |
"description": "Format, validate and edit JSON instantly", | |
"version": "1.0.0", | |
"browser_action": { | |
"default_icon": "icon.png", | |
"default_popup": "popup.html" | |
} | |
} |
This file contains 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
var STORE_KEY = 'jsoneditor-text'; | |
var editor = null; | |
function loadEditor() { | |
var container = document.getElementById('jsoneditor'); | |
var options = { mode: 'code', onChange: onChange }; | |
editor = new JSONEditor(container, options); | |
editor.setText(localStorage.getItem(STORE_KEY) || JSON.stringify({})); | |
} |
This file contains 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
pragma solidity ^0.4.24; | |
contract DocumentTrackContract { | |
struct Document { | |
DocumentVersion[] versions; | |
} | |
struct DocumentVersion { | |
bytes32 hash; | |
uint32 date; |
This file contains 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
// Current Air Quality conditions using SF coordinates (37.7749° N, 122.4194° W) and full features | |
// https://api.breezometer.com/air-quality/v2/current-conditions?lat=37.7749&lon=-122.4194&key=API_KEY&features=breezometer_aqi,local_aqi,health_recommendations,sources_and_effects,pollutants_concentrations,pollutants_aqi_information | |
{ | |
"metadata": null, | |
"data": { | |
"datetime": "2019-02-12T19:00:00Z", | |
"data_available": true, | |
"indexes": { | |
"baqi": { |
This file contains 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
{ | |
"info": { | |
"_postman_id": "267cb468-eb06-4021-9743-6ba3b0c2139d", | |
"name": "Jokes API", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "GET Random Jokes", | |
"event": [ |
This file contains 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
class Database { | |
constructor(url) { | |
this.url = url; | |
} | |
static getInstance() { | |
if (typeof Database.instance === 'object') { | |
return Database.instance; | |
} | |
Database.instance = new Database('http//localhost:8545'); |
This file contains 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
// Products | |
// Abstract Product Class | |
class Vehicle { | |
getPrice() { | |
return `What type of vehicle do you want to get the price for?`; | |
} | |
} |
This file contains 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
class Employee { | |
constructor(name) { | |
this.name = name; | |
} | |
say() { | |
console.log("I am employee " + this.name); | |
}; | |
} |
OlderNewer