Uploaded using the New Issue dialog (and its githubusercontent link copied from the Preview tab)
This file contains hidden or 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 | |
| # Script to check if any affected packages are installed in yarn.lock | |
| # This checks against a list of 288 potentially vulnerable npm packages | |
| # Color codes for output | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| NC='\033[0m' # No Color |
This file contains hidden or 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 python3 | |
| # wsl | |
| import sqlite3 | |
| import json | |
| from pathlib import Path | |
| from datetime import datetime | |
| # path to WorkspaceStorage on Windows or any paths with folders and state.vscdb inside | |
| ENTRY_PATH="/mnt/c/Users/manoj/AppData/Roaming/Cursor/User/workspaceStorage" |
This file contains hidden or 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
| queue = Sidekiq::Queue.new("default") | |
| queue.each do |job| | |
| if job.klass == "DailyFrequencyCreatorWorker" | |
| DailyFrequencyCreatorWorker.set(queue: 'daily_frequency_creator').perform_async(*job.args) | |
| job.delete | |
| end | |
| end;nil |
Update as of 8.08.2021:
- Hid the bookmarks bar and fine-tuned some header styles.
If you want to add your own style to Slack, here's how.
I dunno what happened. I just wanted to try something sporty/future-y, I guess. Code for this is directly below.
This file contains hidden or 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
| # return 1 if alive, 0 if dead | |
| ping_success() { | |
| ! ping -c1 -W1 8.8.8.8 >/dev/null 2>&1 | |
| } | |
| # Spinner taken from https://stackoverflow.com/a/12498395 | |
| spinnerindex=0 | |
| spinner='-\|/' | |
| sleepy_spinner() { | |
| for (( i=0; i<$(($1 * 2)); i++ )) |
This file contains hidden or 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
| # Linux | |
| # add the following to "~/.gitconfig" file | |
| [merge] | |
| tool = intellij | |
| [mergetool "intellij"] | |
| cmd = /usr/local/bin/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED") | |
| trustExitCode = true | |
| [diff] |
This file contains hidden or 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
| # Generate and use an oauth2 bearer token for the Twitter API in Ruby | |
| # | |
| # For Application-Only authentication to the twitter API, a 'bearer token' | |
| # is required to authenticate agains their endpoints for rate limiting | |
| # purposes. | |
| # | |
| # This script generates a bearer token by posting to twitter and then it | |
| # uses that token to poll their API. | |
| # | |
| # Note, the base 64 encoded consumer credentials for the bearer token needs |
This file contains hidden or 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
| stats = Sidekiq::Stats.new | |
| stats.queues | |
| stats.enqueued | |
| stats.processed | |
| stats.failed |
NewerOlder


