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 fs from 'fs'; | |
import { parse } from 'csv-parse'; | |
import path from 'path'; | |
import os from 'node:os'; | |
const CLONE_HERO_SONGS_FOLDER = path.join(os.homedir(), 'Clone Hero', 'Songs'); | |
const CHORUS_DUMP = new URL('Chorus_Dump-export_feb_15_2023.csv', import.meta.url).pathname; | |
const SPOTIFY_DATA_DUMP_FOLDER = new URL('SpotifyData-Aug-26', import.meta.url).pathname; | |
async function run() { |
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 Codegen = require('react-native-codegen'); | |
const FlowParser = require('react-native-codegen-flow-parser'); | |
const FabricObjcGenerator = require('react-native-codegen-fabric-objc-generator'); | |
const ViewConfigGenerator = require('react-native-codegen-viewconfig-generator'); | |
const MarkdownDocumentationGenerator = require('react-native-codegen-markdown-generator'); | |
Codegen({ | |
schema: new FlowParser({ | |
files: ["src/*NativeComponent.js", "src/*NativeModule.js"], | |
otherConfig: true |
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
/* | |
Given two images of equal size, whose dimensions are square with edge length of a power of 2, | |
calculate the overlap of those imagesin O(log(N)) average case where N is the number of pixels. | |
n1 = | |
+----+----+ | |
| 2 | 3 | | |
+----|----| | |
| 2 | 2 | | |
+----|----+ |
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
[alias] | |
cleanup = "!git branch --merged | grep -v '\\*\\|master' | xargs -n 1 git branch -d && git remote prune origin" | |
cleanup-remote = "!git branch -r --merged | grep origin | grep -v '>' | grep -v master | xargs -L1 | cut -d"/" -f2- | xargs git push origin --delete" | |
old-branches = "!git for-each-ref --sort=committerdate --format='%1B[1;34m %(authordate:relative) %1B[m %(refname:short) %1B[1;32m%(authorname)%1B[m' refs/remotes" |
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
Get-ChildItem –Recurse –Include *.jpg,Desktop.ini,thumbs.db –Force | Remove-Item -force #–whatif | |
# pulled from http://guyellisrocks.com/powershell/powershell-script-to-remove-empty-directories/ | |
$items = Get-ChildItem -Recurse | |
foreach($item in $items) | |
{ | |
if( $item.PSIsContainer ) | |
{ | |
$subitems = Get-ChildItem -Recurse -LiteralPath $item.FullName | |
if($subitems -eq $null) |
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
/*Question: | |
Given a non-negative integer k and an array a containing random integers, determine the number of instances where two integers in the array have a numerical difference of k. | |
Do not assume anything about the given inputs unless it is strictly stated. | |
Example 1: | |
k = 4 | |
a = [ 1, 1, 5, 6, 9, 16, 27] |
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 | |
/* | |
d = ['cat', 'cats', 'bat', 'beetle'] | |
similar(q, d): | |
.... | |
returns all words from d with edit distance 1 | |
similar('cat', d) --> ['cat', 'cats', 'bat'] |
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 | |
// $a[0] = [ 1, 2, 3, 4] | |
// $a[1] = [ 5, 6, 7, 8] | |
// $a[2] = [ 9, 10, 11, 12] | |
// $a[3] = [13, 14, 15, 16] | |
// 1 2 3 4 8 12 11 10 9 5 6 7 | |
/* | |
0,0 3,2 |
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 | |
/* | |
INPUT: | |
- an unsorted array of integers, A | |
- an integer q, where 0 < q <= A.size | |
OUTPUT: | |
- find the q_th smallest element in A | |
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
var privateState = require('privatestate'); | |
function formatString(date) { | |
return date.toDateString(); | |
} | |
var Utils = { | |
getDateString: function(date) { | |
return 'today is ' + formatString(date); | |
} |
NewerOlder