Skip to content

Instantly share code, notes, and snippets.

guibot17 guibot17

Block or report user

Report or block guibot17

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
guibot17 / app.get
Created Mar 21, 2019 — forked from tmamedbekov/app.get
Simple readdir with express server. NODE.JS
View app.get
var express = require('express');
var fs = require('fs');
var app = express();
app.get('/logJson', function (req, res) {
const logsFolder = '/folder/path/';
fs.readdir(logsFolder, (err, files) => {
if (err) {
guibot17 / user.js
Created Feb 22, 2019 — forked from EtienneR/user.js
View user.js
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()'GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
} else {
guibot17 / JSON with
Created Feb 21, 2019 — forked from laurenancona/JSON with
Access local JSON data with Javascript
View JSON with


An updated guide/collection of guides on how to access JSON data with JavaScript

Original Question on Stack Exchange.

Example 1

For reading the external Local JSON file (data.json) using java script

View gist:5d352b191dc596d6ec44571695a167ae
"countries": [
"country": "Afghanistan",
"states": ["Badakhshan", "Badghis", "Baghlan", "Balkh", "Bamian", "Daykondi", "Farah", "Faryab", "Ghazni", "Ghowr", "Helmand", "Herat", "Jowzjan", "Kabul", "Kandahar", "Kapisa", "Khost", "Konar", "Kondoz", "Laghman", "Lowgar", "Nangarhar", "Nimruz", "Nurestan", "Oruzgan", "Paktia", "Paktika", "Panjshir", "Parvan", "Samangan", "Sar-e Pol", "Takhar", "Vardak", "Zabol"]
"country": "Albania",
"states": ["Berat", "Dibres", "Durres", "Elbasan", "Fier", "Gjirokastre", "Korce", "Kukes", "Lezhe", "Shkoder", "Tirane", "Vlore"]
guibot17 /
Created Apr 27, 2018 — forked from lopspower/
Hexadecimal color code for transparency

Hexadecimal color code for transparency


How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

guibot17 /
Created Dec 23, 2017 — forked from paulirish/
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.


Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
guibot17 / sample.html
Created Dec 21, 2017 — forked from guillaumegarcia13/sample.html
Angular 4 ng-template & ng-container with parameters
View sample.html
<ng-template #followingpost let-author="author" let-age="age" let-text="text" let-badge="badge">
<div class="container-fluid">
<div class="card">
<div class="header">
<h4 class="title">{{ author }}</h4>
<p class="category">il y a {{ age }} jours</p>
<div class="content" [innerHTML]="text">
guibot17 / snap-to-grid.js
Created Dec 7, 2017 — forked from caleb531/snap-to-grid.js
Makes a jCanvas layer draggable along a defined grid
View snap-to-grid.js
// Available in jCanvas v20.1.0
// The pixel multiple to snap to
var snapToAmount = 40;
// Round the given value to the nearest multiple of n
function nearest(value, n) {
return Math.round(value / n) * n;
layer: true,
guibot17 / audio-api-wrapper.ts
Created Nov 11, 2017 — forked from devfred/audio-api-wrapper.ts
Typescript: HTML5 Audio Wrapper for angular2
View audio-api-wrapper.ts
* @class
* @description
* Wrapper for HTML5 audio.
import {Injectable, NgZone} from 'angular2/core';
import {Observer} from 'rxjs/Observer';
import {Observable} from 'rxjs/Observable';
declare var AudioContext:any;
You can’t perform that action at this time.