Skip to content

Instantly share code, notes, and snippets.

View bdcravens's full-sized avatar

Billy Cravens bdcravens

View GitHub Profile
@bdcravens
bdcravens / es6-class-methods-convert.md
Created August 23, 2021 16:52
Regex to convert es6 class methods to functions

regex: async ([a-zA-Z]+)(\(.*\))

substitution: exports.$1 = async $2 =>

@bdcravens
bdcravens / apple-deadline.md
Created March 28, 2020 19:21
Updated Deadline for App Requirements and Guidelines

Dear {name},

We greatly value the worldwide developer community, and appreciate your commitment to making a difference in people’s lives through the power of technology. To accommodate developers who may need additional time to update their existing apps on the App Store, the deadline for adhering to the requirements below has been extended to June 30, 2020.

  • Apps for iPhone or iPad must be built with the iOS 13 SDK or later and use an Xcode storyboard to provide the app’s launch screen.

  • iPhone apps must support all iPhone screens and all iPad apps must support all iPad screens.

  • Apps for Apple Watch must be built with the watchOS 6 SDK or later.

@bdcravens
bdcravens / rescue-aws-admin.md
Created March 16, 2018 23:40
Forgot AWS admin user

Assumes you forgot (or incorrectly reset) admin user, but have AWS access key/secret key ID with admin rights. You'll need to setup AWS CLI.

aws iam create-user --user-name admin2
aws iam create-login-profile --user-name admin2 --password Admin2018! --no-password-reset-required
aws iam list-groups
aws iam add-user-to-group --group-name Admins --user-name admin2
@bdcravens
bdcravens / docker-sync.yml
Created February 24, 2018 23:02
docker-sync config with ignores for Rails
# docker-sync.yml
version: 2
syncs:
my-app-sync:
src: './'
sync_strategy: 'native_osx'
sync_excludes: ['tmp','.git','coverage', 'log']
@bdcravens
bdcravens / eth-price.AppleScript
Created September 1, 2017 02:35
apple script to pull eth price
set json to (do shell script "curl https://www.bitstamp.net/api/v2/ticker/ethusd")
tell application "JSON Helper"
set result to read JSON from json
set price to |last| of result as number
end tell
set result_string to "$" & price & ""
@bdcravens
bdcravens / cybercoders-spam.md
Created July 22, 2017 21:24
cybercoders-spam

I am not on the job market. I haven't put out an updated resume in years. While I have experience in the technologies listed here, the only way I'd be connected is if your recruiters are actively scouring the Internet for skills and then making unsolicited communications.

I have been received these communications from your company for years, and every attempt to Unsubscribe both through automated means as legally required by CANSPAM, as well as direct communication with recruiters, has failed. I will click the Unsubscribe link again after sending this email. My presumption is that CyberCoders's qualification for hiring technology resources is reflected by how well they can manage their database of email addresses.

Some entertaining reading material:

https://edoceo.com/blog/2016/06/cybercoders-shameful-recruit-solicitation

http://recruitingdaily.com/recruiting-spam/

@bdcravens
bdcravens / retries_counts.rb
Last active May 17, 2016 17:36
Count retries by queue in sidekiq
retries_by_queue = {}
Sidekiq::RetrySet.new.each {|r| retries_by_queue[r.klass] += 1 }
puts retries_by_queue
@bdcravens
bdcravens / rebuild_index.sql
Created April 23, 2016 20:04
View table index fragmentation and rebuild index
SELECT a.index_id, name, avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats (DB_ID(N'my_db'), OBJECT_ID(N'dbo.my_table'), NULL, NULL, NULL) AS a
JOIN sys.indexes AS b ON a.object_id = b.object_id AND a.index_id = b.index_id;
ALTER INDEX idx_myIndex ON my_table
REBUILD WITH (FILLFACTOR = 80);
@bdcravens
bdcravens / app_controllers_slack_controller.rb
Created November 27, 2015 19:55 — forked from patio11/app_controllers_slack_controller.rb
Implementing a /healthcheck endpoint in Slack to read out consul status in a human-readable fashion
class SlackController < ApplicationController
skip_before_action :verify_authenticity_token
@@slack_security_tokens =
["copy-paste-the-token-you-get-from-Slack-when-configuring-the-integration-here"]
before_filter :bounce_access_not_from_slack
def healthcheck
services = SystemStatus.list_services
@bdcravens
bdcravens / sabre_mashery.html
Created July 28, 2015 21:40
seen on Mashery site
<!-- This no script tag lets people rocking with their JS turned off see content. Buttheads. -->
<noscript>
<style>
#page, #footer {display:block}
</style>
</noscript>