Skip to content

Instantly share code, notes, and snippets.

@TALlama
TALlama / anonymizer.rb
Created May 17, 2024 16:03
This class will use your existing FactoryBot factories to rewrite the data already in the db, keeping the associations and structure but replacing the content.
class Anonymizer
include ActiveSupport::Benchmarkable
attr_reader :factory_names, :callbacks
def initialize(factory_names = nil, callbacks = {})
raise ArgumentError.new("You must be in development to use the anonymizer") unless Rails.env.development?
require Rails.root.join("spec/factories") unless FactoryBot.factories.count > 0
@factory_names = [*factory_names].compact.map(&:to_sym)
@sverrirs
sverrirs / AsyncBackgroundProcessor.cs
Created December 16, 2015 22:58
Asynchronous background processor code for WPF or WinForms that behaves similar to the BackgroundWorker class in the .NET framework but leverages the Task framework.
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace RectifyLib
{
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 21, 2024 16:45
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active May 21, 2024 16:45 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active May 21, 2024 16:44
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@crojewsk
crojewsk / skl_hdadmic-howto.md
Last active May 21, 2024 16:41
Enabling HDA (dsp) plus DMIC audio configuration on Skylake and Kabylake platforms
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 21, 2024 16:41
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@timothywarner
timothywarner / az900sg.md
Created October 15, 2020 12:31
AZ-900 Microsoft Azure Fundamentals Study Blueprint
@nderkach
nderkach / recognizer.py
Last active May 21, 2024 16:38
Facebook photo upload and photo tagging
#!/usr/bin/env python
import requests
import re
import urllib.parse
import sys, os
import json
from requests_toolbelt import MultipartEncoder
BASE_URL = 'https://mbasic.facebook.com'