Skip to content

Instantly share code, notes, and snippets.

// .eslintrc.js
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
@guyisra
guyisra / scientificToDecimal.js
Created April 2, 2018 06:46 — forked from jiggzson/scientificToDecimal.js
Converts a javascript number from scientific notation to a decimal string
function scientificToDecimal(num) {
//if the number is in scientific notation remove it
if(/\d+\.?\d*e[\+\-]*\d+/i.test(num)) {
var zero = '0',
parts = String(num).toLowerCase().split('e'), //split into coeff and exponent
e = parts.pop(),//store the exponential part
l = Math.abs(e), //get the number of zeros
sign = e/l,
coeff_array = parts[0].split('.');
if(sign === -1) {
@guyisra
guyisra / history.txt
Last active November 24, 2016 05:10 — forked from unak/history.txt
The History of Ruby
* Only the releases of the stable versions are enumerated in principle. The releases of the unstable versions especially considered to be important are indicated as "not stable."
* The branches used as the source of each releases are specified, and the branching timing of them are also shown. BTW, before subversionizing of the repository, the term called "trunk" was not used, but this list uses it in order to avoid confusion.
* In order to show a historical backdrop, big conferences (RubyKaigi, RubyConf and Euruko) are also emurated. About the venues of such conferences, general English notations are adopted, in my hope.
* ruby_1_8_7 branch was recut from v1_8_7 tag after the 1.8.7 release becaouse of an accident.
* 1.2.1 release was canceled once, and the 2nd release called "repack" was performed. Although there were other examples similar to this, since the re-releases were performed during the same day, it does not write clearly in particular.
* Since 1.0 was released with the date in large quantities,
@guyisra
guyisra / gist:8510019a84dd7fffa3cb
Created November 29, 2014 16:20
s3_direct_upload with preview and delete
add: (e, data) ->
file = data.files[0]
r = new FileReader()
r.onload = (e) ->
file.result = e.target.result
r.readAsDataURL(file)
file.unique_id = Math.random().toString(36).substr(2,16)
unless settings.before_add and not settings.before_add(file)
current_files.push data