This file contains hidden or 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 async function csvToJsonAsync(path: string) { | |
| const bottles: any[] = []; | |
| const readable = fs.createReadStream(path, { encoding: 'utf-8' }); | |
| const rl = readline.createInterface({ | |
| input: readable, | |
| output: process.stdout, | |
| }); | |
| let isFirstLine = true; | |
| let headers: string[]; |
This file contains hidden or 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
| const fs = require("node:fs"); | |
| const { Transform, Readable } = require("node:stream"); | |
| const INPUT = ["aaa", "aAa", "aab"]; | |
| const regex = /aaa/i; | |
| // logger helper | |
| function create_logger(prefix) { | |
| return { | |
| log: (...[message, ...args]) => |
This file contains hidden or 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 autobind from 'autobind-decorator'; | |
| import glamorous from 'glamorous'; | |
| import React from 'react'; | |
| import { theme } from '../styles/theme'; | |
| interface TextInputProps { | |
| type?: string; | |
| value?: string; | |
| label?: string; |
This file contains hidden or 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 { mockServer } from 'graphql-tools'; | |
| import schema from './schema.graphql' | |
| const mockApi = mockServer(schema, { | |
| Int: () => 6, | |
| Float: () => 22.1, | |
| String: () => 'Hello', | |
| }); | |
| expressApp.post('/graphql', async (req, res) => { |
This file contains hidden or 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
| .album{ | |
| text-align: center; | |
| background: #333; | |
| padding: 10px 20px; | |
| border:#666 1px solid; | |
| } | |
| .album-thumb{ | |
| width:100%; | |
| } |
This file contains hidden or 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
| .artist-header{ | |
| padding-bottom:20px; | |
| margin-bottom:20px; | |
| border-bottom:solid 1px #000; | |
| } | |
| .artist-thumb{ | |
| width:80px; | |
| height:auto; | |
| float:left; |
This file contains hidden or 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 { Component, OnInit } from '@angular/core'; | |
| import { FormGroup, FormBuilder, Validators } from '@angular/forms'; | |
| import { Hero } from '../shared/hero'; | |
| import { forbiddenNameValidator } from '../shared/forbidden-name.directive'; | |
| @Component({ | |
| moduleId: module.id, | |
| selector: 'hero-form-reactive3', | |
| templateUrl: 'hero-form-reactive.component.html' | |
| }) | |
| export class HeroFormReactiveComponent implements OnInit { |
This file contains hidden or 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 { createStore, applyMiddleware, compose } from 'redux'; | |
| import createLogger from 'redux-logger'; | |
| import rootReducer from '../reducers'; | |
| const isDev = process.env.NODE_ENV === 'development'; | |
| function getMiddleware() { | |
| const middleware = []; |
This file contains hidden or 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
| ########################################## | |
| # To run: | |
| # curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x | |
| ########################################## | |
| # Check that HTTPS transport is available to APT | |
| if [ ! -e /usr/lib/apt/methods/https ]; then | |
| sudo apt-get update | |
| sudo apt-get install -y apt-transport-https | |
| fi |
This file contains hidden or 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
| {} |
NewerOlder