Skip to content

Instantly share code, notes, and snippets.

James Martinez jamescmartinez

Block or report user

Report or block jamescmartinez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jamescmartinez
jamescmartinez / disable-retweets.js
Last active Mar 7, 2018
Want to disable retweets for everyone you're following? Run this script on the Twitter following page. https://twitter.com/following --- Inspired by this post: https://www.theatlantic.com/magazine/archive/2018/04/the-case-against-retweets/554078/
View disable-retweets.js
document.querySelectorAll("div.ProfileCard-content div.dropdown").forEach(function(element){
element.querySelector("button").click();
element.querySelector("li.retweet-off-text button").click();
});
@jamescmartinez
jamescmartinez / ruby-on-raspbian.md
Last active Nov 8, 2018
Script to Install Latest Ruby on Raspberry Pi (Raspbian)
View ruby-on-raspbian.md
# Install asdf, our Ruby version manager
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc

# Install dependencies (source: https://github.com/asdf-vm/asdf/blob/master/README.md)
sudo apt-get update
sudo apt-get install automake autoconf libreadline-dev libncurses-dev libssl-dev libyaml-dev libxslt-dev libffi-dev libtool unixodbc-dev
@jamescmartinez
jamescmartinez / trackday_checklist.md
Last active Aug 13, 2019
My checklist for trackdays and races
View trackday_checklist.md

Week Before

  • Inspect Motorcycle
  • Purchase Track Day / Register for Race

Motorcycle

  • Motorcycle
  • Motorcycle Key
  • Tools
  • Oil Funnel
  • Zip Ties
@jamescmartinez
jamescmartinez / .gitignore
Created Apr 14, 2017
.gitignore for iOS projects
View .gitignore
.DS_Store
*.xcuserstate
xcuserdata
Pods
@jamescmartinez
jamescmartinez / .gitignore
Last active Jan 11, 2017
New Node Project .gitignore and package.json
View .gitignore
.DS_Store
node_modules
npm-debug.log
@jamescmartinez
jamescmartinez / slack_emails.rb
Created Nov 10, 2016
This Ruby script will fetch email addresses for all of your members. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
View slack_emails.rb
require 'csv'
require 'json'
require 'net/http'
token = ''
uri = URI("https://slack.com/api/users.list?token=#{token}")
response = Net::HTTP.get(uri)
members = JSON.parse(response)['members']
@jamescmartinez
jamescmartinez / githubssh.sh
Created Mar 25, 2016
Because setting up SSH on GitHub shouldn't take 10 pages of tutorials...
View githubssh.sh
ssh-keygen -t rsa -b 4096 -C "YOUR_EMAIL_HERE@EXAMPLE.COM"
pbcopy < ~/.ssh/id_rsa.pub
@jamescmartinez
jamescmartinez / html5boilerplate.html
Created Mar 17, 2016
Super simple, no frills HTML5 boilerplate!
View html5boilerplate.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello, World!</title>
<link rel="stylesheet" href="stylesheet.css">
</head>
<body>
Hello, World!
<script src="javascript.js"></script>
@jamescmartinez
jamescmartinez / slack_delete.rb
Last active Oct 23, 2019
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
View slack_delete.rb
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@jamescmartinez
jamescmartinez / snapchat_decrypt.rb
Last active May 27, 2019
Snapchat Image Decrypt - This Ruby script decrypts the blob received from the `bq/blob` endpoint. Many thanks to @kivikakk, @adamcaudill, @tlack, and @NeilHanlon for inspiration, code, guides, and of course, the encryption key.
View snapchat_decrypt.rb
#!/usr/bin/env ruby
require 'openssl'
data = File.open('blob', 'r:ASCII-8BIT').read
c = OpenSSL::Cipher.new('AES-128-ECB')
c.decrypt
c.key = 'M02cnQ51Ji97vwT4'
o = ''.force_encoding('ASCII-8BIT')
data.bytes.each_slice(16) { |s| o += c.update(s.map(&:chr).join) }
You can’t perform that action at this time.