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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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 fetch = url => new Promise((resolve, reject) => { | |
https.get(url, res => { | |
res.setEncoding('utf8'); | |
let result = null; | |
res.on('data', data => { | |
result = JSON.parse(data); | |
}); | |
res.on('end', () => { | |
if (res.statusCode != 200) { | |
reject("Error code " + res.statusCode); |
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
/** dash between num-letter */ const dbnl = [/(\d)([a-zA-Z])|([a-zA-Z])(\d)/g, '$1$3-$2$4']; | |
/** special characters to dash */ const sc2d = [/[^a-zA-Z0-9]+/g, '-']; | |
/** uppercase to dash */ const u2d = [/([A-Z])/g, '-$1']; | |
/** Common preconversion */ | |
const commonPre = fn => cacheStringFunction(str => fn(str.replace(...u2d).replace(...dbnl).replace(...sc2d))); | |
/** dash before a letter */ const dbl = /-([a-zA-Z])/g; | |
export const capitalizeWords = cacheStringFunction(str => str.toLowerCase().replace(/\b(\w)/g, (_, c) => (c ? c.toUpperCase() : ''))); |
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
/* eslint-disable @typescript-eslint/no-var-requires */ | |
const { execSync } = require('child_process'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const paths = [ | |
path.resolve(__dirname, 'package.json'), | |
path.resolve(__dirname, 'node_modules', 'last.package.json'), | |
]; |
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
#!/usr/bin/env bash | |
cd "$(dirname "${BASH_SOURCE[0]}")" | |
if [ ! -e ./vendor ]; then | |
docker run --rm \ | |
-u "$(id -u):$(id -g)" \ | |
-v "$(pwd):/var/www/html" \ | |
-w /var/www/html \ | |
laravelsail/php83-composer:latest \ |