Skip to content

Instantly share code, notes, and snippets.

View philipszdavido's full-sized avatar

Chidume Nnamdi philipszdavido

View GitHub Profile

Essentials of JavaScript

Introduction to JavaScript

JavaScript Basics

@philipszdavido
philipszdavido / README.txt
Created November 6, 2021 10:05
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
import 'dart:io';
import 'package:flutter/foundation.dart';
/// Allows you to set and enable a proxy for your app
class CustomProxy {
/// A string representing an IP address for the proxy server
final String ipAddress;
/// The port number for the proxy server
/// Can be null if port is default.
@philipszdavido
philipszdavido / erc20-token-sample.sol
Created January 24, 2021 14:13 — forked from bajcmartinez/erc20-token-sample.sol
Necessary code to generate an ERC20 Token
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// Sample token contract
//
// Symbol : LCST
// Name : LCS Token
// Total supply : 100000
// Decimals : 2
// Owner Account : 0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe

Ways to debounce Http requests in Angular

Debouncing is the delay of a function/method execution or an action for a period of the specified time. During this specified time, calls to the method/function or action are collected and executes each one when the specified has elapsed.

Suppose you have a blog website with a search bar where users can search for posts. When a user types in the name of a blog to search in the search bar, an HTTP request is sent to the web API to search for blog post names or mentions with the search tokens.

You will find out that the server will always be called on every single letter typed. For example, you want articles based on "Javascript" and "optimization", then you typed "Javascript optimization". For every single letter in "Javascript optimization", the server will be called plus space, i.e the server will be called 23 times just to search for blog posts with "Javascript optimization" keywords and *ngFor will trigger change detection run on the component 10 times.

The c

let timers = [] // eg. setTimeout(...), setInterval(...)
let pending_callbacks = []
let idle = [] // eg. requestIdleCallback(...)
let prepare = []
let poll = [] //eg. HTTP conns, Socket conns, file ops
let check = [] // eg. setImmediate(...)
let close = [] // eg. socket.on('close',()=>{...})
let exit=[]
const log = console.log

Title: 16 useful NPM packages to use in Node.js + Express apps.

  • Introduction

  • What is Node.js?

  • What is NPM (Node Package Manager)?

  • What is Express?

  • What NPM packages will we use

  • App We will build

  • Server setup

    1. express: creating our server

Introduction

TensorFlow is an open source software library created by Google that is used to implement machine learning and deep learning systems. These two names contain a series of powerful algorithms that share a common challenge — to allow a computer to learn how to automatically spot complex patterns and/or to make best possible decisions.

**TensorFlow: a modern machine learning library **

TensorFlow, open sourced to the public by Google in November 2015, is the result of years of lessons learned from creating and using its predecessor, DistBelief. It was made to be flexible, efficient, extensible, and portable. Computers of any shape and size can run it, from smartphones all the way up to huge computing clusters. It comes with lightweight software that can instantly productionize your trained model, effectively eliminating the need to reimplement models.

TensorFlow embraces the innovation and community engagement o f open source, but has the support, guidance, and stability of a large

function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},
@philipszdavido
philipszdavido / readme.md
Created January 4, 2018 19:02 — forked from mixonic/readme.md
Services for Glimmer.js

Setup

In config/environment.js:

// config/environment.js
'use strict';

/*
 * Mostly this is the stock module config.