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 java.nio.charset.Charset; | |
import java.nio.charset.StandardCharsets; | |
import java.util.Base64; | |
public class Main { | |
public static void main(String[] args) { | |
Charset c = StandardCharsets.UTF_8; | |
String str = "ブラウン ✊ 𠮷野家"; | |
byte[]b = Base64.getEncoder().encode(str.getBytes(c)); |
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 quicksort(arr: number[]): number[] { | |
const pivot = arr[Math.floor((arr.length - 1) / 2)]; | |
const progress = arr.reduce<[number[], number[]]>( | |
(ret, n) => { | |
const first = ret[0]; | |
const second = ret[1]; | |
if (n < pivot) { | |
if (first[0] && first[0] > n) { | |
first.unshift(n); | |
} else { |
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 quicksort(arr) { | |
const pivot = arr[Math.floor((arr.length - 1) / 2)]; | |
const progress = arr.reduce( | |
(ret, n) => { | |
const first = Array.isArray(ret[0]) ? ret[0] : []; | |
const second = Array.isArray(ret[1]) ? ret[1] : []; | |
if (n < pivot) { | |
if (first[0] && first[0] > n) { | |
first.unshift(n); | |
} else { |
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
async function quicksort(arr) { | |
const pivot = arr[Math.floor((arr.length - 1) / 2)]; | |
const progress = arr.reduce( | |
(ret, n) => { | |
const first = Array.isArray(ret[0]) ? ret[0] : []; | |
const second = Array.isArray(ret[1]) ? ret[1] : []; | |
if (n < pivot) { | |
if (first[0] && first[0] > n) { | |
first.unshift(n); | |
} else { |
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
el.scrollIntoView({ block: 'center', behavior: 'smooth' }); |
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
if [ -d ~/dotfiles ]; then | |
cd ~/dotfiles | |
git pull origin master | |
cd - | |
else | |
git clone git@github.com:sugarshin/dotfiles.git ~/dotfiles | |
fi | |
/bin/sh ~/dotfiles/setup.sh |
Probably one of the easiest things you'll ever do with gpg
Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH
First get the public key
keybase pgp export --query <hash> | gpg --import
Next get the private key
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
REPOS=(\ | |
$REPO0 \ | |
$REPO1 \ | |
) | |
for repo in "${REPOS[@]}"; do ag -s -G 'package.json' '(babelcli|d3.js|ffmepg|jquery.js|mysql.js|openssl.js)' $repo ; 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
git checkout --orphan prebuilt | |
cd sub-dir | |
npm run build | |
cd - | |
mv -f sub-dir/package.json ./package.json | |
mv sub-dir/lib ./lib | |
git reset # | |
vim .gitignore # Delete /lib/ | |
git add package.json lib | |
git commit -m 'Prebuilt' |
NewerOlder