This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from "styled-components"; | |
const Placeholder = styled.div` | |
margin-top: 25vh; | |
text-align: center; | |
font-family: Arial, Helvetica, sans-serif; | |
img { | |
width: 100px; | |
} | |
h1 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("dotenv").config(); | |
const path = require("path"); | |
const Dotenv = require("dotenv-webpack"); | |
module.exports = { | |
webpack: config => { | |
config.plugins = config.plugins || []; | |
config.plugins = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "devjam-dashboard", | |
"version": "1.0.0", | |
"description": "A small administrative dashboard for DevJam.", | |
"main": "index.js", | |
"author": "Dennis Bruijn", | |
"license": "MIT", | |
"dependencies": { | |
"body-parser": "^1.19.0", | |
"bootstrap": "^4.4.1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
fonts: { | |
body: 'system-ui, sans-serif', | |
heading: '"Avenir Next", sans-serif', | |
monospace: 'Menlo, monospace', | |
}, | |
colors: { | |
text: '#000', | |
background: '#fff', | |
primary: '#33e', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require utility tools and child_process exec to execute CLI commands | |
const util = require("util"); | |
const exec = util.promisify(require("child_process").exec); | |
// define a async function execute commands | |
async function executeCommands(CommandLineString) { | |
const { stdout, stderr } = await exec(CommandLineString); | |
console.log("Standard output:", stdout); | |
console.log("Standard error:", stderr); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require the enquirer module | |
const { MultiSelect } = require("enquirer"); | |
// create a new multi select prompt | |
const multiSelectPrompt = new MultiSelect({ | |
name: "value", | |
message: "Select all the binaries that you want to install", | |
choices: frequentlyUsedBinaries | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make a list of frequently used binaries | |
const frequentlyUsedBinaries = [ | |
"iterm2", | |
"visual-studio-code", | |
"google-chrome", | |
"zsh", | |
"whatsapp", | |
"spectacle", | |
"spotify", | |
"slack", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env node | |
// will tell shell enviroment which program it needs execute this, in our case it's node | |
// always run your code in strict mode | |
"use strict"; | |
console.log(`My first Node CLI app 🎉`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Headers, Http, Response} from "@angular/http"; | |
export class GenericClass { | |
constructor(public http: Http) {} | |
public MyHttpPostMethod() { | |
// create a new promise and resolve it if possible | |
return new Promise((resolve) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from '@angular/core'; | |
// Declare TabsService as a provider in app.module.ts | |
// Inject TabsService in your class: constructor(public tabs: TabsService){} | |
// Use the this.tabs.hide() or this.tabs.show() methods wherever you want | |
@Injectable() | |
export class TabsService { | |
constructor() {} | |
public hide() { |
NewerOlder