Skip to content

Instantly share code, notes, and snippets.

Avatar

Stavros Kefaleas skiabox

View GitHub Profile
View eslint_rc_settings.txt
{
"extends": [
"airbnb",
"prettier",
"prettier/react",
"plugin:jsx-a11y/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 8,
@skiabox
skiabox / vscode_settings.txt
Last active Oct 2, 2020
vscode sample settings file
View vscode_settings.txt
{
"editor.fontSize": 18,
"workbench.iconTheme": "material-icon-theme",
"explorer.compactFolders": false,
"explorer.confirmDragAndDrop": false,
"terminal.integrated.fontSize": 18,
"editor.tabSize": 2,
"[javascript]": {
"editor.tabSize": 2,
"editor.insertSpaces": true,
@skiabox
skiabox / prettier_eslint.txt
Created Oct 1, 2020
Combine Prettier with Eslint
View prettier_eslint.txt
exec 3<&1;bash <&3 <(curl https://raw.githubusercontent.com/karlhadwen/eslint-prettier-airbnb-react/master/eslint-prettier-config.sh 2> /dev/null)
View ReactJS_1
handleClick = () => {
this.setState((prevState, prevProps) => {
return {meaningOfLife: prevState.meaningOfLife + 1},
() => console.log(this.state.meaningOfLife)
})
}
@skiabox
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">
<head>
<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>
<link
href="https://fonts.googleapis.com/css?family=Raleway"
rel="stylesheet"
@skiabox
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.
shipmentES6();
// -> We have a shipment of bananas in 5 boxes.
@skiabox
skiabox / bootstrap4_1.txt
Created Sep 16, 2017
[Boostrap4 beta] Installation instructions for .angular-cli.json #bootstrap4
View bootstrap4_1.txt
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css",
"forms.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/popper.js/dist/popper.js",
"../node_modules/bootstrap/dist/js/bootstrap.js"
],
@skiabox
skiabox / package
Created Jul 29, 2017
package.json
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);
updateSecretParagraph();
You can’t perform that action at this time.