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" | |
"os" | |
"strings" | |
) | |
func check(e error) { | |
if e != nil { |
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" | |
"os" | |
"regexp" | |
"strconv" | |
"strings" | |
) |
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" | |
"os" | |
"strings" | |
) | |
func check(e error) { | |
if e != nil { |
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" | |
"os" | |
"sort" | |
"strconv" | |
"strings" | |
) |
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 axios = require('axios') | |
const fs = require('fs') | |
const jobs = [] | |
for (let index = 0; index < 40; index++) { | |
jobs.push('https://static.parastorage.com/services/promote-seo/1.2335.0/business-manager-component.bundle.min.js') | |
} | |
console.log('running ',+jobs.length, ' jobs') | |
console.time('download and write') | |
Promise.all(jobs.map((url, i) => axios.get(url).then(({data}) => { |
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
interface Job { | |
path: string, | |
try: number // intially 0 | |
} | |
const pool = someWorkersPoolLibrary() | |
const Q = downloadAllRules() | |
while(Q.length || pool.pendingJobs) { | |
const currentJob = Q.unshift() |
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 cases = require('./cases'); | |
const caseRunner = require('../../utils/caseRunner'); | |
const parse = (input) => { | |
return input | |
.split('\n') | |
.filter(Boolean) | |
.map((r) => r.split('')); | |
}; |
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 id = ({ i, j }) => `${i},${j}`; | |
const parse = (input) => { | |
return input.split('\n').map((row) => row.split('')); | |
}; | |
const getNeighbors = (maze, i, j) => { | |
const di = [-1, 0, 1, 0]; | |
const dj = [0, 1, 0, -1]; | |
const ns = []; |
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
type MatrixFn = ( | |
cell?: any, | |
{ y, x }?: { y: number; x: number }, | |
matrix?: any[][] | |
) => any; | |
export const Matrix = (matrix: any[][]) => { | |
return { | |
forEach(fn: MatrixFn) { | |
matrix.forEach((_, row) => { |
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
bubbleSort(randomArray, (action) => { | |
actionsMap[action.type](action, arrayMembers); | |
ctx.clearRect(0, 0, innerWidth, innerHeight); | |
drawAll(); | |
}); |
NewerOlder