Skip to content

Instantly share code, notes, and snippets.

View 0x263b's full-sized avatar

Abram 0x263b

View GitHub Profile
@0x263b
0x263b / discord_delete.rb
Created April 30, 2018 06:42
Delete discord post history
#!/usr/bin/env ruby
# encoding: utf-8
Encoding.default_external = "UTF-8"
Encoding.default_internal = "UTF-8"
require "open-uri"
require "json"
require "net/https"
require "uri"

Keybase proof

I hereby claim:

  • I am 0x263b on github.
  • I am posadist (https://keybase.io/posadist) on keybase.
  • I have a public key ASBpW8FplS7lBqX9G44WmdUZeKeXwDcGF4u0PHcFkUTIMgo

To claim this, I am signing this object:

@0x263b
0x263b / colors.md
Last active March 7, 2024 10:09
Random color from string in javascript

Random color from string in javascript

Consider a list of strings you need to permanently assign a random color.

First you should turn the string into a hash.

var string = "string"
var hash = 0
@0x263b
0x263b / twitter_goggles.rb
Last active July 14, 2016 15:07
Twitter Goggles
#!/usr/bin/env ruby
# encoding: utf-8
# Ruby version of Twitter Goggles
# https://github.com/ardubs/goggles
require 'oauth'
require 'json'
# Create a twitter app with Read and Write, then fill the values below
@0x263b
0x263b / slack_logs.rb
Last active March 9, 2020 00:56
Obtain channel logs from Slack's API
#!/usr/bin/env ruby
# encoding: utf-8
# Uses the following Slack API methods:
# user.list → https://api.slack.com/methods/users.list
# channels.history → https://api.slack.com/methods/channels.history
require "open-uri"
require "json"
# Obtain a token
@0x263b
0x263b / nginx_letsencrypt.md
Last active November 13, 2018 18:45
Nginx + Let's Encrypt

First, set up your cert directory

$ mkdir /var/www/dehydrated
$ cd /var/www/dehydrated

Download dehydrated, and make it runnable.

@0x263b
0x263b / example.md
Created May 11, 2016 18:51
Puma + Nginx + Upstart

Assuming your domain is example.com and your apps root directory is /var/www/example.com

Puma

cd into the root directory and create directories var/run, var/log. This is where your domain socket and server logs will be stored.

Next create a file puma.rb with the following

threads 1, 6
void setup() {
size(500, 500);
frameRate(30);
}
float pos = TWO_PI;
void draw() {
colorMode(HSB, 360, 100, 100);
background(0,0,0);
@0x263b
0x263b / tweet_archive.rb
Created October 18, 2015 18:01
A script to download all of a user's tweets into a json file
require 'oauth'
require 'json'
$TWITTER_CONSUMER_KEY = ""
$TWITTER_CONSUMER_SECRET = ""
$TWITTER_ACCESS_TOKEN = ""
$TWITTER_ACCESS_TOKEN_SECRET = ""
def prepare_access_token(oauth_token, oauth_token_secret)