Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
"Thanks, but I'm tired of programming."

Garen Torikian gjtorikian

💭
"Thanks, but I'm tired of programming."
View GitHub Profile
View HOW_IT_WORKS.md

Check out the YouTube link for additional help: https://youtu.be/MoZtlB06yys

  1. Go to https://vax4nyc.nyc.gov/patient/s/vaccination-schedule
  2. Fill out all your personal details
  3. Copy this script above
  4. In your browser, open up Developer Tools
  5. Paste this script into the console
  6. Sit back and wait for an appointment you like to appear. This usually takes about ten minutes.

If the page stops refreshing (because it found an appointment), but you don't like the time or location, just type:

@gjtorikian
gjtorikian / pro-up.rb
Last active Jan 7, 2021
Is there new info on MacRumors yet
View pro-up.rb
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
model = 'MacBook_Pro_16'
url = "https://buyersguide.macrumors.com/\##{model}"
doc = Nokogiri::HTML(URI.open(url))
@gjtorikian
gjtorikian / main.go
Created Oct 13, 2020
Heroku chat sample
View main.go
package main
import (
"encoding/json"
"io"
"log"
"net/http"
"os"
"github.com/go-redis/redis"
@gjtorikian
gjtorikian / querying_for_files.graphql
Last active Feb 22, 2019
sample GQL query for fetching files via GitHub GQL API
View querying_for_files.graphql
{
# get a list of files off the tree entries
repository(owner: "gjtorikian", name: "html-proofer") {
ref(qualifiedName: "refs/heads/master") {
target {
... on Commit {
tree {
entries {
object {
__typename
@gjtorikian
gjtorikian / extract.rb
Last active May 27, 2018
Geocities extraction script
View extract.rb
require 'pty'
def run_cmd(cmd)
begin
PTY.spawn( cmd ) do |stdout, stdin, pid|
begin
# Do stuff with the output here. Just printing to show it works
stdout.each { |line| print line }
rescue Errno::EIO
puts "Errno:EIO error, but this probably just means " +
View sample-blame.graphql
{
repository(owner: "facebook", name: "mention-bot") {
object(expression: "master") {
... on Commit {
blame(path: "cookieJar.js") {
ranges {
startingLine
endingLine
age
commit {
@gjtorikian
gjtorikian / routes.rake
Created Mar 15, 2016
Rake task to show Sinatra routes within a Rails app
View routes.rake
namespace :api do
# Sample output is a header (listing the class name) followed by
# the verb + endpoint. For example:
#
# ### Within Api::Git
#
# GET /repositories/:repository_id/git
desc "List all the API endpoints with their verbs."
task :routes => :environment do
View sinatra.diff
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb
index 3b07ab0..b76ef47 100644
--- a/lib/sinatra/base.rb
+++ b/lib/sinatra/base.rb
@@ -2,6 +2,7 @@
require 'rack'
require 'tilt'
require 'rack/protection'
+require 'forwardable'
View convert_to_backticks.rb
Dir.glob('content/**/*.md') do |file|
content = File.read(file)
content = content.gsub(/{:.terminal}\n[\s\S]*?^$/) do |match|
lines = match.lines
lines = lines[1..-1].map do |line|
line[4..-1]
end
lines.unshift("``` command-line\n")
lines << "```\n"
@gjtorikian
gjtorikian / random.rb
Created Oct 6, 2015
Script to generate random files
View random.rb
LORUM = %w(lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat volup