Skip to content

Instantly share code, notes, and snippets.

Stavros Kefaleas skiabox

Block or report user

Report or block skiabox

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
skiabox / app.js
Created Jan 25, 2020
Binary Gap Algorithm in javascript ES6
View app.js
//A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.
const toBinaryString = number => {
return number.toString(2); // returns a string
function solution(N) {
const nBinaryString = toBinaryString(N);
let numberOfZeroes = 0;
let max = 0;
// loop through letters
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Form Styling</title>
skiabox / es6_javascript_snippet.js
Created Aug 30, 2019
ES6 Destructured Objects Parameters #ES6 #Javascript
View es6_javascript_snippet.js
function shipmentES6({ items = 'bananas', number = 5, package = 'boxes' } = {}) {
console.log(`We have a shipment of ${items} in ${number} ${package}.`);
shipmentES6({ package: 'crates' });
// -> We have a shipment of bananas in 5 crates.
shipmentES6({ items: 'tomatoes', number: 18 });
// -> We have a shipment of tomatoes in 18 boxes.
// -> We have a shipment of bananas in 5 boxes.
skiabox / bootstrap4_1.txt
Created Sep 16, 2017
[Boostrap4 beta] Installation instructions for .angular-cli.json #bootstrap4
View bootstrap4_1.txt
"styles": [
"scripts": [
skiabox / package
Created Jul 29, 2017
View package
"name": "WebpackTypescript1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack-dev-server",
"build:prod": "webpack -p"
View app.ts
import '../css/main.css';
import '../css/input-elements.css';
import {secretButton, secretParagraph } from './dom-loader';
let showSecret: boolean = false;
secretButton!.addEventListener('click', toggleSecretState);
View dom-loader.ts
export const secretButton: Element | null = document.querySelector('#secret-button');
export const secretParagraph: Element | null = document.querySelector('#secret-paragraph');
skiabox / webpack.config.js
Last active Sep 18, 2017
View webpack.config.js
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: './src/js/app.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist'
skiabox / tsconfig
Last active Jul 29, 2017
View tsconfig
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation: */
"allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
skiabox / index.html
Last active Sep 17, 2017
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Webpack 3 with Typescript</title>
You can’t perform that action at this time.