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
import mitt from "mitt" | |
import EventEmitter3 from "eventemitter3" | |
const iterations = 100000 | |
// Mitt | |
const mittEmitter = mitt() | |
console.time("Mitt: on") | |
for (let i = 0; i < iterations; i++) { | |
mittEmitter.on("event", () => {}) |
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
#!/usr/bin/env python | |
import boto3 | |
import sys | |
PROFILE = sys.argv[1] | |
BUCKET = sys.argv[2] | |
session = boto3.Session(profile_name = PROFILE) | |
s3 = session.resource('s3') | |
bucket = s3.Bucket(BUCKET) |
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 fs = require("fs") | |
const line = fs.readFileSync("/dev/stdin").toString().split("\n") | |
const limit = Number(line[0]) | |
console.log(line.slice(1, limit + 1).reduce( (result, l, idx, arr) => { | |
const [a, b] = l.split(/\s/).map(Number) | |
return result + (a + b) + "\n" | |
}, "")) |
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
function solution(input) { | |
const first = input[0].split(/\s/) | |
const n = parseInt(first[0]) | |
const m = parseInt(first[1]) | |
const cardArray = input[1].split(/\s/).map(l=>parseInt(l)) | |
let max = 0, sum = 0 | |
for (let i = 0; i < n - 2 ; i++) { | |
for (let ii = i + 1; ii < n - 1; ii++) { | |
for ( let iii = ii + 1; iii < n ; iii++) { |
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
find . -type f -printf "%T@ %f\n" | sort -n > out.txt |
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
<template> | |
<div class="tweet"> | |
<article class="media"> | |
<figure class="media-left"> | |
<p class="image is-64x64"> | |
<img class="user-image" :src="tweet.userImage"> | |
</p> | |
</figure> | |
<div class="media-content"> | |
<div class="content"> |
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
for m in *.m4a | |
do ffmpeg -v 5 -y -i $m -acodec libmp3lame -ac 2 -ab 192k "${m%.m4a}.mp3" | |
done |
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
mounted() { | |
Vue.nextTick(() => { | |
const hash = this.$route.hash | |
if (hash) { | |
const element = document.querySelector(hash) | |
document.scrollingElement.scroll({ | |
top: element.offsetTop, | |
}) | |
} | |
}) |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
var ( | |
test = []string{ | |
"11B804806F367001", |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
t := time.Now() | |
if t.Hour() > 12 { |
NewerOlder