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
FEATURE_BRANCH=fill-me | |
echo "Backup feature branch to server" | |
git checkout ${FEATURE_BRANCH} | |
git push origin ${FEATURE_BRANCH} | |
echo "Refresh main" | |
git checkout main | |
git pull origin main |
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
/** Inspired by https://classic.yarnpkg.com/blog/2016/11/24/lockfiles-for-all/ | |
* | |
* Produces a yarn.lock that should be commented but does it ONLY for dev dependencies. | |
*/ | |
import fs from 'node:fs' | |
import { execSync, exec } from 'node:child_process' | |
const getOutput = (cmd) => execSync(cmd).toString() |
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 json | |
def find_meaning(param): | |
return 11 | |
def try_luck(param): | |
return 7 |
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
Regexp: | |
\/\*\*\n\s*\*(.{1,80})\n\s*\*\/ | |
With: | |
/**$1 */ | |
From: | |
/** | |
* Foobar | |
*/ |
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 | |
docker ps -aqf "status=exited" | xargs -r docker rm -f | |
docker images -qf "dangling=true" | xargs -r docker rmi -f | |
docker volume ls -qf "dangling=true" | xargs -r docker volume rm |
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
ffmpeg -i input.mp4 -vf scale=360:640 -pix_fmt rgb24 output.gif |
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
from abc import ABCMeta, abstractproperty | |
import unittest | |
import mock | |
class BaseTest(unittest.TestCase): | |
__metaclass__ = ABCMeta |
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/sh | |
# Put to /usr/bin/sample-program | |
sleep 600 & | |
PID="$!" | |
# Trap is required to kill all child processes when the service is stopped | |
trap "kill $PID" exit INT TERM KILL TERM |
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
""" | |
Glossary used in the functions below: | |
Node can be virtually any hashable datatype. | |
:param start: starting node | |
:param end: ending node | |
:param weighted_graph: {"node1": {"node2": "weight", ...}, ...} | |
""" |
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
""" | |
Publish the function to S3: | |
cd $DIR_WITH_THIS_SCRIPT | |
zip find_latest_ami_name.zip find_latest_ami_name.py | |
aws s3 cp find_latest_ami_name.zip s3://$YOUR_S3_BUCKET/find_latest_ami_name.zip | |
""" | |
import json |
NewerOlder