Skip to content

Instantly share code, notes, and snippets.

View cvega's full-sized avatar
🎛️
git commit -m '[FIXED] - *'

Casey Vega cvega

🎛️
git commit -m '[FIXED] - *'
  • GitHub Staff
  • San Francisco, CA
  • 13:35 (UTC -07:00)
  • LinkedIn in/caseyvega
View GitHub Profile
// external/public order testing (requires casperjs, and conf.js)
//
// we have a json file (conf.js) that contains all of our services, the tiers
// related to those services and litle & co certification billing/transaction
// data. We use this data to drive the tests and loop over each tier of service
// with each type of card transaction data.
casper.options.waitTimeout = 60000;
casper.start();
casper.then(function() {
@cvega
cvega / latency.txt
Created January 31, 2017 16:48 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@cvega
cvega / sed cheatsheet
Last active November 24, 2020 19:56 — forked from un33k/sed cheatsheet
sed cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@cvega
cvega / Jenkinsfile.groovy
Last active April 19, 2020 04:31 — forked from Faheetah/Jenkinsfile.groovy
CLOUDBEES: Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'No quotes in single backticks'
sh 'echo $BUILD_NUMBER'
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"'
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"'
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"'
echo 'Using three backslashes still results in preserving the single quotes'
@cvega
cvega / web-servers.md
Created October 27, 2017 15:40 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@cvega
cvega / search_arn_acm_by_domain.sh
Last active April 19, 2020 04:36
AWS - ACM ARN by Domain Name using JQ
AWS_DEFAULT_REGION="us-east-1"
DOMAIN_NAME="snakeoil.dom"
cmd=$(aws acm list-certificates --region=$AWS_DEFAULT_REGION \
| jq -r ".CertificateSummaryList[] \
| select(.DomainName == $DOMAIN_NAME) \
| .CertificateArn")
echo $cmd
@cvega
cvega / InfoJSON.cs
Last active May 26, 2020 16:20
rust - oxide items json
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;
using UnityEngine;
// items.json plugin for oxide (return JSON array with rust items (id, name, shortname, craftingStackable)
namespace Oxide.Plugins
@cvega
cvega / javascript_warnings.md
Created April 2, 2020 02:50 — forked from laurent22/javascript_warnings.md
How many warnings should your JavaScript app have?

How many warnings should your JavaScript app have?

JavaScript warnings are these messages being displayed in yellow or red in your JavaScript console or terminal. They make no sense at all in general but they are a good indication of the health of your app. The points below will give you a general idea of how many warnings you should expect in your app:

  • 0 warnings: the app is not working at all

  • 5 warnings: app is probably starting but crashing soon after - try to find why it crashes. You'd think you could read the warnings to learn why it doesn't work, but that's not what warnings are for.

  • 50 warnings: That's the soft spot - most likely everything's running smoothly

@cvega
cvega / README.md
Last active April 19, 2020 04:28
CLOUDBEES: Artifactory/Customtools Functions for post install configuration

Artifactory/Customtools Functions for post install configuration

This a MVP for a global library that will configure artifactory and customtools post install as a job.

This can live as a global variable in /vars of your global pipeline. If this file was config.groovy you can call these functions as config.artifactory()

See below how to wire the global lib into casc

@cvega
cvega / Storing-Images-On-Github.md
Last active May 15, 2020 19:54 — forked from joncardasis/Storing-Images-On-Github.md
Storing Images and Demos in your Repo

Storing Images and Demos in your Repo

In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.

How to

1. Clone a fresh copy of your repo

In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.

2. Create a new branch

Create a new branch in your repo by using git checkout --orphan assets