Skip to content

Instantly share code, notes, and snippets.

View mcfearsome's full-sized avatar
💭
hacking the mainframe

mcfearsome mcfearsome

💭
hacking the mainframe
View GitHub Profile
@mcfearsome
mcfearsome / read_github_json.py
Created March 26, 2022 05:44 — forked from porthunt/read_github_json.py
Read json file from a private GitHub repository
import base64
import json
import requests
REPO_URL = "https://api.github.com/repos/<USER>/<REPO>/contents/<PATH>/<TO>/<FILE>.json"
TOKEN = "<YOUR PAT OR OAUTH TOKEN>"
headers = {
"Authorization": f"token {TOKEN}",
"Accept": "application/vnd.github.v4+raw"
#!/usr/bin/env ruby
#
# Cleanup Sidekiq uniquejobs in Redis
# see https://github.com/mhenrixon/sidekiq-unique-jobs/issues/195
#
require 'bundler/setup'
require 'sidekiq/api'
DRY_RUN = true
if rails_env = ENV['RAILS_ENV']
rails_root = File.basename(Dir.pwd)
rails_env_string = case rails_env
when 'development'
'dev'
when 'production'
'prod'
else
rails_env
CmdUtils.CreateCommand({
name: "twitter-timeline",
description: "Browse Twitter Timeline",
preview: function(pblock, directObject) {
var twitterHome = "http://twitter.com/home";
jQuery.get( twitterHome, {}, function(data) {
CmdUtils.loadJQuery(function(jQuery){
pblock.innerHTML = jQuery("#timeline",data).html();
});
}, "html");