Skip to content

Instantly share code, notes, and snippets.

View m0nkey's full-sized avatar

Jesse Heady m0nkey

View GitHub Profile
@miguelmota
miguelmota / webdriver_full_page_screenshots.js
Last active May 3, 2023 04:56
Selenium Webdriver Node.js take screenshots of entire page
var webdriver = require('selenium-webdriver')
var assert = require('assert')
var fs = require('fs')
// Input capabilities
var capabilities = {
'browserName' : 'Chrome',
'browser_version' : '66.0',
'os' : 'Windows',
'os_version' : '10',
@fIa5h
fIa5h / AMI_NR.js
Last active April 22, 2020 17:05
Ryan & Bruce
/*
New Relic GPT ad monitoring code
//
This snippet captures PageActions containing references to Google publisher tag ads
Should you have any questions about this, please reach out to me at [email protected]
Please note that you must be using New Relic's SPA browser agent.
//
*/
//
//first, make sure the newrelic object exists properly
@renatorib
renatorib / operator_with_ligatures.md
Last active January 11, 2024 06:45
Using Operator Mono with Fira Code ligatures in Atom.

Using Operator Mono with Fira Code ligatures in Atom.

  1. Open your Atom's Stylesheet
    image

  2. Put this css

atom-text-editor {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
@UndefinedOffset
UndefinedOffset / nr-deploy-post-merge-hook.sh
Last active July 9, 2021 10:19
A simple git deploy hook for notifying New Relic of deployments, it assumes that the base folder name of the repository is the application name. To set git to use this script you simply add this file into your .git/hooks folder as "post-merge".
#!/bin/bash
#New Relic API Key see https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/api-key#creating
NR_API_KEY="INSERT_API_KEY_HERE"
#Find New Relic App Name, if your top level folder is not the name of your application change the below two lines to simply NR_APP_NAME="MY_APP_NAME".
NR_APP_NAME=$(git rev-parse --show-toplevel)
NR_APP_NAME=$(basename "$NR_APP_NAME")
#Get the current git branch
@brandondurham
brandondurham / styles.less
Last active June 24, 2024 14:48
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
@mediaupstream
mediaupstream / jekyll-deploy.sh
Created November 19, 2015 10:34
Jekyll website deploy script, using scp
#!/bin/bash
user="username"
host="example.com"
port=22
site_folder="_site"
remote_folder="/var/www/example.com/"
scp -P $port -r ${site_folder}/* ${user}@${host}:${remote_folder}
@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@vgeshel
vgeshel / function.js
Last active February 9, 2022 09:19
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
@shaykalyan
shaykalyan / ohmyzsh-theme-guide.md
Last active September 23, 2024 09:23
Oh My Zsh theme with Powerline font guide
@shadowbq
shadowbq / cdn-reverse-check.rb
Last active January 2, 2021 06:08
Check if reverse dns lookup matches a known CDN. (used for unblocking in blacklists)
#/usr/bin/env ruby
# github/shadowbq - 2014
# GNU GENERAL PUBLIC LICENSE Version 2, June 1991
# Things to match..
# CDN List provided by - (23 Dec 2014) https://github.com/WPO-Foundation/webpagetest/blob/master/agent/wpthook/cdn.h
require 'rubygems'
require 'net/dns'