Skip to content

Instantly share code, notes, and snippets.

@Dascr32
Dascr32 / cst.bat
Created August 4, 2015 17:25
Simple batch script that test your internet connection. It tells the number and time of disconnections. Also creates a log file in the c:/ drive with all the events.
@Echo off
title Connection Stability Test / Dascr32
cls
set /A disconnections=1
echo Start time:
time/t
echo ============================================ >> c:\cstb-log.txt
@pjlsergeant
pjlsergeant / selfgol.pl
Created July 9, 2012 13:36
Damien Conway's Selfgol
#!/usr/local/bin/perl -sw
$;=$/;seek+DATA,!++$/,!$s;$_=<DATA>;$s&&print||$g&&do{$y=($x||=20)*($y||8);sub
i{sleep&f}sub'p{print$;x$=,join$;,$b=~/.{$x}/g}$j=$j;sub'f{pop}sub
n{substr($b,&f%$y,3)=~tr,O,O,}sub'g{$f=&f-1;($w,$w,substr($b,&f,1),O)[n($f-$x)+
n($x+$f)-(substr($b,&f,1)eq+O)+n$f]||$w}$w="\40";$b=join'',@ARGV?<>:$_,$w
x$y;$b=~s).)$&=~/\w/?O:$w)ge;substr($b,$y)=q++;$g='$i=0;$i?$b:$c=$b;
substr+$c,$i,1,g$i;$g=~s?\d+?($&+1)%$y?e;$i-$y+1?eval$g:do{$i=-1;$b=$c;p;i
1}';sub'e{eval$g;&e}e}||eval||die+No.$;
__DATA__
if($j){{$^W=$|;*_=sub{$=+s=#([A-z])(.*)#=#$+$1#=g}}
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active May 6, 2024 20:49
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@infocynic
infocynic / SalesforceIntegrationLicenseHOWTO.md
Last active May 6, 2024 20:48
How to use Salesforce Integration User Licenses

How to make an integration user using the new licenses that became available in April 2023:

If you want to just do it the "easy" way and have the minimum number of PSets, completely bespoke for this integration:

  1. Make a user with the Minimum Access - API Only Integration Profile.
  2. Create a new Permission set that has the "Salesforce API Integration" license. There is a very similarly named license that will not work. Be sure you are using this one. Add all the permissions you need in this pset.
  3. If you are working with packages like Salesforce CPQ, you may need to make additional PSets that have Permission Set Licenses. Those permission sets cannot apply App or System Permissions. **You cannot use any Permission Set that requires a different User License, such as "Salesforce."
  4. Assign this/these Pset(s) to the user
  5. Assign the Integration PSL to that user
@jordienr
jordienr / tailwind.config.ts
Created July 15, 2023 09:10
Tailwind SVG Grid Background
// Remember to install mini-svg-data-uri
// Follow me on twitter for memes @jordienr
import { type Config } from "tailwindcss";
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
const svgToDataUri = require("mini-svg-data-uri");
export default {
@ashwinreddy
ashwinreddy / Spotify.lua
Created February 13, 2019 04:19
Hammerspoon configuration to update Mac wallpaper background to the currently playing Spotify track's album artwork
hs.loadSpoon("ReloadConfiguration")
spoon.ReloadConfiguration:start()
function resetImage()
screen = hs.screen.mainScreen()
screen:desktopImageURL("file:///Users/areddy/Pictures/original_8ee2e1707ce7198a75211221f99e6c2d.jpeg")
end
function updateImage()
@veuncent
veuncent / aws_glacier_delete_vault.md
Last active May 6, 2024 20:45
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 
@qoomon
qoomon / conventional_commit_messages.md
Last active May 6, 2024 20:41
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@atyachin
atyachin / aws_regions.json
Created September 29, 2020 19:08
AWS Regions / Datacenters Geo Locations
[
{
"code": "us-east-1",
"region": "US East",
"city": "Virginia",
"lat": 38.9940541,
"long": -77.4524237,
"country": "US"
},
{
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 20:41
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules