Skip to content

Instantly share code, notes, and snippets.

View ccondry's full-sized avatar

Coty Condry ccondry

  • Cisco Systems
  • Texas
View GitHub Profile
@vexx32
vexx32 / start-noita.ps1
Last active March 21, 2024 10:56
Starts Noita from the given path, optionally with a specific seed set.
function Start-Noita {
<#
.SYNOPSIS
Starts Noita from a PowerShell prompt, optionally with a specific set seed for a new game.
.DESCRIPTION
To use this function, copy and paste the complete function definition into a PowerShell
session, and then invoke it with `Start-Noita`. Supply `-Seed somevalue` if you would like
to run a specific seed (see the examples below).
@hmontazeri
hmontazeri / listAllObjectsFromS3Bucket.js
Last active April 2, 2024 03:00
get more than 1000 elements from s3 bucket (node.js)
const AWS = require('aws-sdk');
const s3 = new AWS.S3({
region: 'eu-central-1',
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
});
async function listAllObjectsFromS3Bucket(bucket, prefix) {
let isTruncated = true;
@ccondry
ccondry / get-public-ip.sh
Created January 23, 2020 19:08
get public IP
#!/bin/sh
dig +short myip.opendns.com @resolver1.opendns.com
# or use the following:
# dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
const csvStringToArray = strData =>
{
const objPattern = new RegExp(("(\\,|\\r?\\n|\\r|^)(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|([^\\,\\r\\n]*))"),"gi");
let arrMatches = null, arrData = [[]];
while (arrMatches = objPattern.exec(strData)){
if (arrMatches[1].length && arrMatches[1] !== ",")arrData.push([]);
arrData[arrData.length - 1].push(arrMatches[2] ?
arrMatches[2].replace(new RegExp( "\"\"", "g" ), "\"") :
arrMatches[3]);
}
@tanaikech
tanaikech / submit.md
Last active April 3, 2024 05:38
Multipart-POST Request Using Node.js

Multipart-POST Request Using Node.js

Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.

Sample script 1:

  • You can upload the zip file by converting byte array as follows.
    • At first, it builds form-data.
    • Adds the zip file converted to byte array and boundary using Buffer.concat().
    • This is used as body in request.
@ygotthilf
ygotthilf / jwtRS256.sh
Last active April 17, 2024 04:10
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten