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
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
exit 0; | |
elif [ $# -eq 1 ]; then | |
printf "$@" | |
exit 0 | |
fi | |
msg=${@: -1:1} |
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
trait SourceInfo { | |
type NoInfoType <: this.type | |
val NoInfo: NoInfoType | |
def showMessage(msg: String): String | |
} | |
object NoPositionInfo extends PositionInfo(NoPosition) { | |
override def showMessage(msg: String): String = s"${pos.toString}: $msg" | |
} |
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
function* seq(a, b, delta = 1) { | |
let num = a; | |
let correction = 0; | |
while (num <= b) { | |
yield num; | |
const delta_ = delta - correction; | |
const next = num + delta_; | |
correction = (next - num) - delta_; | |
num = next; | |
} |
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
package { | |
import flash.events.SampleDataEvent; | |
import flash.media.Sound; | |
import flash.media.SoundChannel; | |
import flash.utils.ByteArray; | |
public class LoopPlayer extends Object{ | |
private var sound:Sound; | |
private var loopStart:Number; | |
private var loopEnd:Number; | |
private var channel:SoundChannel; |
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
type Inconsistent = { foo: string } & { foo: number }; | |
// const obj: Inconsistent = { foo: 123 }; // error, consistently | |
function trick<O: {}, K: string, V>(obj: O, key: K, val: V): O & { [K]: V } { | |
obj[key] = val; | |
return obj; | |
} | |
const obj = trick({ foo: "bar" }, "foo", 123); |
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
let rec length1 = function | |
| [] -> 0 | |
| _ :: tl -> 1 + length1 tl | |
let length2 list = | |
let rec _length2 n = function | |
| [] -> n | |
| _ :: tl -> _length2 (n + 1) tl | |
in | |
_length2 0 list |
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
function shortenWord(word) { | |
return word.length <= 3 | |
? word | |
: word[0] + (word.length - 2).toString() + word[word.length - 1]; | |
} | |
function shorten(str) { | |
return str.replace(/[^\d\W]+/g, shortenWord); | |
} |
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 make opened Markdown files always be soft wrapped: | |
# | |
# path = require 'path' | |
# |
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
Show hidden characters
{ | |
"parserOptions":{ | |
"ecmaVersion": 8 | |
}, | |
"env": { | |
"es6": true, | |
"node": true | |
}, | |
"extends": "eslint:recommended", | |
"rules": { |
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
'atom-text-editor:not(.mini):not(.autocomplete-active).markdown-table-editor-active': | |
'tab': 'markdown-table-editor:next-cell' |