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 yarnLockfile = require('@yarnpkg/lockfile'); | |
function parseLockfile(filePath) { | |
const file = fs.readFileSync(filePath, 'utf8'); | |
return yarnLockfile.parse(file).object; | |
} | |
function getVersionDifferences(beforeLockfile, afterLockfile) { | |
const diffs: Record<string, { before: string, after: string }> = {}; |
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 file in *.HEIC; do sips -s format jpeg "$file" --out "${file%.*}.jpg"; 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
// https://stackoverflow.com/a/67504622/51500 | |
import { | |
DependencyList, | |
EffectCallback, | |
useCallback, | |
useEffect, | |
useRef, | |
} from "react"; | |
import { debounce } from "lodash"; |
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
#!/bin/bash | |
wget http://downloads.sourceforge.net/ltp/lcov-1.14-1.noarch.rpm | |
sudo yum localinstall lcov-1.14-1.noarch.rpm | |
git clone --recursive https://github.com/RedisTimeSeries/RedisTimeSeries.git | |
cd RedisTimeSeries | |
sudo make setup |
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
#!/bin/bash | |
############################################### | |
# To use: | |
# chmod +x install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
version=6.0.8 |
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
// Based on https://stackoverflow.com/questions/565535/mocking-a-url-in-java | |
package com.example | |
import java.io.InputStream | |
import java.net.HttpURLConnection | |
import java.net.URL | |
class FakeResourceHttpURLConnection( | |
url: URL, |
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
/** | |
* Retries the provided [block] up to [times] times if the block throws an exception of the type | |
* [exceptionType]. If any other exception type is thrown, the exception is caught and then | |
* immediately rethrown. | |
*/ | |
fun retryIfThrown(times: Int, exceptionType: KClass<out Throwable>, block: () -> Unit) { | |
for (i in 0 until times) { | |
try { | |
block() | |
break |
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
# Install all the packages | |
sudo yum install -y \ | |
curl gpg gcc gcc-c++ make git \ | |
openssl-devel readline-devel libcurl-devel \ | |
zlib-devel postgresql-server.x86_64 ruby-devel \ | |
sqlite sqlite-devel ruby-rdoc python-devel \ | |
cairo-devel libffi-devel python-pip nc docker \ | |
tmux htop postgresql-libs postgresql-devel \ | |
amazon-cloudwatch-agent |
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
sudo yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel -y | |
mkdir ~/ffmpeg_sources | |
# nasm | |
cd ~/ffmpeg_sources | |
curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 | |
tar xjvf nasm-2.14.02.tar.bz2 | |
cd nasm-2.14.02 | |
./autogen.sh | |
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" |
NewerOlder