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 zsh | |
if [ -t 0 ]; then | |
# Argument | |
input="$1" | |
else | |
# STDIN | |
input="$(cat /dev/stdin)" | |
fi |
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
device = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu' |
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 ruby | |
require 'open3' | |
require 'json' | |
ffmpeg_bin = '/usr/local/bin/ffmpeg' | |
target_il = -16.0 | |
target_lra = +11.0 | |
target_tp = -1.0 | |
samplerate = '41k' |
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
launchctl unload -w ~/Library/LaunchAgents/com.google.keystone.xpcservice.plist | |
launchctl unload -w ~/Library/LaunchAgents/com.google.keystone.agent.plist | |
echo > ~/Library/LaunchAgents/com.google.keystone.xpcservice.plist | |
echo > ~/Library/LaunchAgents/com.google.keystone.agent.plist | |
chmod 644 ~/Library/LaunchAgents/com.google.keystone.xpcservice.plist | |
chmod 644 ~/Library/LaunchAgents/com.google.keystone.agent.plist | |
sudo chown root ~/Library/LaunchAgents/com.google.keystone.xpcservice.plist |
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 { S3Client, PutObjectCommand, GetObjectCommand, DeleteObjectCommand } from "@aws-sdk/client-s3"; | |
const s3Client = new S3Client({ region: "us-east-1" }); | |
const Bucket = "BUCKET_NAME_GOES_HERE"; | |
export const handler = async (event) => { | |
let statusCode = 200; | |
let body = ``; | |
if (event.requestContext.http.method === "POST") { |
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 | |
class Users extends CI_Model { | |
function add($options=array()) { | |
// required values | |
if (!$this->_required(array('email'), $options)) return false; | |
// default values | |
$options = $this->_default(array('status'=>'active'), $options); | |
// qualification (make sure that we're not allowing the site to insert data that it shouldn't) |
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 ( | |
"bytes" | |
"strconv" | |
) | |
func cf(a string) (s string) { | |
var e bytes.Buffer | |
r, _ := strconv.ParseInt(a[0:2], 16, 0) |
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
open -a "Google Chrome" --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security |
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
console.log(JSON.stringify(data ?? null, null, 2)) | |
[...Array(10).keys()] | |
const sleep = ms => new Promise(res => setTimeout(res, ms)); | |
const sum = arr => arr.reduce((sum, n) => sum + n, 0) | |
const avg = arr => sum(arr) / arr.length |
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 { writeFile } from "fs/promises"; | |
import axios from "axios"; | |
const main = async () => { | |
try { | |
const response = await axios.get(`${FILE_URL}`, { responseType: "arraybuffer" }); | |
try { | |
await writeFile(`./${FILE_NAME}.jpg`, response.data); | |
} catch(err) { | |
console.log(err); |
NewerOlder