An updated guide/collection of guides on how to access JSON data with JavaScript
Original Question on Stack Exchange.
For reading the external Local JSON file (data.json) using java script
An updated guide/collection of guides on how to access JSON data with JavaScript
Original Question on Stack Exchange.
For reading the external Local JSON file (data.json) using java script
| require('socket.io-client')('wss://myserver:port/ws', { transports: ['websocket'], rejectUnauthorized: false }); |
| function empty(v) { | |
| let type = typeof v; | |
| if(type === 'undefined') { | |
| return true; | |
| } | |
| if(type=== 'boolean') { | |
| return !v; | |
| } | |
| if(v === null) { | |
| return true; |
$ cp /etc/redis.conf /etc/redis-xxx.conf...| from cx_Freeze import setup, Executable | |
| setup(name='name', | |
| version='0.1', | |
| description='description', | |
| executables = [Executable("name of the script to convert")] | |
| ) | |
| # run using: python <name of this file.py> build |
The plan is to take a simple nodejs server. and add to it simple file serving capabilities. also to have a custom responce to a certien url. to be able to make a simple api in addition of serving files.
goals:
| (function () { | |
| /* converted by @brakmic */ | |
| /* original code: https://github.com/isaacs/json-stringify-safe */ | |
| /* usage example: | |
| * | |
| *angular.module("myModule", ['jsonStringify']) | |
| * .controller("MainCtrl", ['StringifyJsonService', MainCtrl]); | |
| * |
| import React from ‘react’; import { findDOMNode } from ‘react-dom’; import $ from ‘jquery’; class FullDesc extends React.Component { constructor() { super(); } handleToggle = () => { const el = findDOMNode(this.refs.toggle); $(el).slideToggle(); }; render() { return ( <div className=”long-desc”> <ul className=”profile-info”> <li> <span className=”info-title”>User Name : </span> Shuvo Habib </li> </ul> <ul className=”profile-info additional-profile-info-list” ref=”toggle”> <li> <span className=”info-email”>Office Email</span> me@shuvohabib.com </li> </ul> <div className=”ellipsis-click” onClick={this.handleToggle}> <i className=”fa-ellipsis-h”/> </div> </div> ); } } export default FullDesc; |
| #!/opt/local/bin/php | |
| <?php | |
| /* | |
| 1) replace the shebang (first line) with the path to your php binary | |
| (probably something like /usr/bin/php) | |
| 2) move the file to /usr/local/bin/datauri.php | |
| (this should be in your PATH) | |
| 3) chmod ugo+rx /usr/local/bin/datauri.php | |
| (make the script executable for everyone) |
| #!/opt/local/bin/php | |
| <?php | |
| /* | |
| 1) replace the shebang (first line) with the path to your php binary | |
| (probably something like /usr/bin/php) | |
| 2) move the file to /usr/local/bin/datauri.php | |
| (this should be in your PATH) | |
| 3) chmod ugo+rx /usr/local/bin/datauri.php | |
| (make the script executable for everyone) |