Skip to content

Instantly share code, notes, and snippets.

View solrevdev's full-sized avatar
💭
🤓

John Smith solrevdev

💭
🤓
View GitHub Profile
@troyhunt
troyhunt / rick-roll-content-scraper.js
Created August 19, 2020 07:41
A Cloudflare worker to redirect image requests from dickhead content scraper's site to a Rick Roll
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
async function fetchAndApply(request) {
let response = await fetch(request)
let referer = request.headers.get('Referer')
let contentType = response.headers.get('Content-Type') || ''
if (referer && contentType.startsWith('image/')) {
@RafaelRuales
RafaelRuales / Virustotal Scanner
Last active July 2, 2022 11:34 — forked from hahnicity/Virustotal Scanner
Python code to scan a list of URLs programmatically with virustotal. Requires a virustotal API key to work
"""
virustotal_scan
~~~~~~~~~~~~~~~
Programmatically scan URLs with virustotal.
"""
import argparse
import json
import os
@solrevdev
solrevdev / setup.sh
Created July 6, 2020 20:50 — forked from chris-sev/setup.sh
Mac Setup
# how to run this thingy
# create a file on your mac called setup.sh
# run it from terminal with: sh setup.sh
#!/bin/bash
set -euo pipefail
# Display message 'Setting up your Mac...'
echo "Setting up your Mac..."
sudo -v
@jdavid82
jdavid82 / .vimrc
Last active December 2, 2024 09:40
vim settings for full stack C# development in Windows 10
"Allow project specific .vimrc execution
set exrc
"no backup files
set nobackup
"only in case you don't want a backup file while editing
set nowritebackup
"no swap files
@mtilson
mtilson / script.sh
Last active July 31, 2024 16:49
how to run Shell commands from GitHub with help of Curl and shortened Git.io URLs [github]
## How to run Shell commands from GitHub with help of Curl and shortened Git.io URLs [github]
# With help of GitHub web UI create public repository (repository name: `REPO`) under
# your GitHub user account (user name: `USER`). This results in Git repository URL
# of `https://github.com/USER/REPO.git`
# Initialize local Git repository and create, commit, and push to the `master` branch
# (or other one) a file (file name: `run`) with shell commands you'd like to run
git init
git remote add origin https://github.com/USER/REPO.git
@tigt
tigt / git-branch-to-favicon.js
Created March 18, 2020 21:10
Creates an SVG string that can be used as a favicon across different Git branches. Actually getting this into the browser is sadly project-specific.
const { execSync } = require('child_process')
const { createHash } = require('crypto')
const invertColor = require('invert-color')
const branchName = execSync('git rev-parse --abbrev-ref HEAD')
const hash = createHash('sha256')
hash.update(branchName)
const color = '#' + hash.digest().toString('hex').substring(0, 6)
const invertedColor = invertColor(color, true)
@mikegrima
mikegrima / edit_brave_dictionary.md
Last active December 12, 2024 19:40
Edit Brave Browser Dictionary

Fix Brave Browser Dictionary

If you have ever mistakenly added a word to the Brave browser dictionary, you need to manually edit the Custom Dictionary.txt file.

As of March 2020, the Brave UI lacks a feature to do this.

Where is the file?

This will depend on your OS. Google for where this is on your OS.

The file on macOS is at: ~/Library/Application\ Support/BraveSoftware/Brave-Browser/Default/Custom\ Dictionary.txt.

@ErikEJ
ErikEJ / IQueryableExtensions.cs
Last active March 30, 2025 14:29
Replacement for EF Core .Contains, that avoids SQL Server plan cache pollution
using System.Linq.Expressions;
namespace Microsoft.EntityFrameworkCore
{
public static class IQueryableExtensions
{
public static IQueryable<TQuery> In<TKey, TQuery>(
this IQueryable<TQuery> queryable,
IEnumerable<TKey> values,
Expression<Func<TQuery, TKey>> keySelector)
@anderly
anderly / CacheService.cs
Last active May 9, 2025 23:27
MediatR Caching Pipeline Behavior
public class CacheService : ICache
{
private readonly string _keyPrefix;
private readonly IDistributedCache _cache;
private readonly IConfiguration _config;
public CacheService(IDistributedCache cache, IConfiguration config)
{
_cache = cache;
_config = config;
@pishangujeniya
pishangujeniya / reset-mysql-8-root-password-windows.md
Created December 5, 2019 18:04
Reset MySQL 8.0 root Password in Windows

Reset MySQL 8.0 root Password in Windows

  1. Stop the MySQL 8.0service from services
  2. Go to path C:\Program Files\MySQL\MySQL Server 8.0\bin and open cmd
  3. Run mysqld --console --skip-grant-tables --shared-memory
  4. Open new cmd in the same path
  5. Run following commands
  6. mysql -u root
  7. select authentication_string,host from mysql.user where user='root';
  8. UPDATE mysql.user SET authentication_string='' WHERE user='root';