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
LIST = "⠹⠼⠶⠧⠏⠛" | |
LIGHT = "⢕⡪" | |
SPEED = 1 | |
trap "SIGINT" do | |
exit! | |
end | |
def loader(speed=SPEED, list=LIST) | |
list[(Time.now.to_f * 10 ** speed).to_i % list.length] |
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
LIST = "⠹⠼⠶⠧⠏⠛" | |
LIGHT = "⢕⡪" | |
SPEED = 1 | |
def loader(speed=SPEED, list=LIST) | |
list[(Time.now.to_f * 10 ** speed).to_i % list.length] | |
end | |
# Add this line to your loop | |
print "Loading... #{ loader(1, LIST) }\r" |
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
<?php | |
return new class extends Sophie | |
{ | |
function mount() | |
{ | |
$this->author = fn() => new Author; | |
$this->date = fn() => new DateTime; | |
$this->body = fn() => random_text(); | |
$this->tags = fn() => [random_string(), random_string()]; |
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
task('bundle', () => { | |
source('src/MyLib.ts').rollup({ | |
format: 'umd', | |
name: 'mylib', | |
plugins: [ | |
typescript(), | |
prepack(), | |
], | |
}).tofile('dist/mylib.js') | |
})) |
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
const uglify = require('uglify-js') | |
const fs = require('fs') | |
module.exports = async options => { | |
const params = {} | |
if ('sourcemap' in options && 'filename' in options) { | |
params.sourceMap = { | |
filename: options.filename, | |
url: 'inline', | |
} |
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
const { CLIEngine } = require('eslint') | |
const { logger } = require('just-task') | |
module.exports = options => { | |
const eslint = new CLIEngine() | |
const formatter = eslint.getFormatter() | |
const { results } = eslint.executeOnFiles([options.glob]) | |
if (results.reduce((value, item) => value + item.errorCount, 0)) { | |
logger.info(formatter(results)) | |
throw new Error('Linter has found errors') |
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
const rollup = require('rollup') | |
const typescript = require('rollup-plugin-typescript2') | |
const prepack = require('rollup-plugin-prepack-up') | |
module.exports = async options => { | |
await rollup.rollup({ | |
input: options.input, | |
plugins: [ | |
typescript({ useTsconfigDeclarationDir: true }), | |
prepack(), |
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
const { CLIEngine } = require('eslint') | |
const rollup = require('rollup') | |
const typescript = require('rollup-plugin-typescript2') | |
const prepack = require('rollup-plugin-prepack-up') | |
exports.lint = function* () { | |
yield new Promise((resolve, reject) => { | |
const eslint = new CLIEngine() | |
const formatter = eslint.getFormatter() | |
const { results } = eslint.executeOnFiles(['src/**']) |
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
const typescript = require('rollup-plugin-typescript2') | |
const prepack = require('rollup-plugin-prepack-up') | |
module.exports = grunt => { | |
grunt.loadNpmTasks('grunt-eslint') | |
grunt.loadNpmTasks('grunt-rollup') | |
grunt.loadNpmTasks('grunt-contrib-uglify') | |
grunt.initConfig({ | |
eslint: { |
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
const { src, dest, series } = require('gulp') | |
const eslint = require('gulp-eslint') | |
const rollup = require('gulp-better-rollup') | |
const typescript = require('rollup-plugin-typescript2') | |
const prepack = require('rollup-plugin-prepack-up') | |
const ts = require('gulp-typescript') | |
const sourcemaps = require('gulp-sourcemaps') | |
const uglify = require('gulp-uglify') | |
const rename = require('gulp-rename') |