Skip to content

Instantly share code, notes, and snippets.

View unRARed's full-sized avatar

Ryan Richardson unRARed

View GitHub Profile
@unRARed
unRARed / slack_delete.rb
Created May 17, 2018 16:44 — forked from jamescmartinez/slack_delete.rb
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.
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,
@unRARed
unRARed / elixirphoenix.bash
Created January 3, 2017 00:54 — forked from likethesky/elixirphoenix.bash
Installing Elixir & the Phoenix framework with Homebrew on OS X
$ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered!
$ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it.
$ brew install elixir
$ mix local.hex # Answer y to any Qs
$ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw...
# Use the latest Phoenix from here: http://www.phoenixframework.org/docs/installation -- currently this is 1.0.3
# ** Answer y to any Qs **
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez
@unRARed
unRARed / placehold-404.php
Last active November 4, 2015 21:31 — forked from CurtisL/placehold-404.php
Wordpress filter to replace 404'd images with a placeholder, Good for when you're working locally but don't want to copy down the whole uploads directory.
<?php
/**
* Dev Helper for 404'd Images
*/
function placehold_404( $image ) {
if ( !file_exists( str_replace(get_home_url().'/', '', $image[0]) ) ) {
// Replace the image source with a placeholder at the proper dimensions.
$image[0] = "http://placehold.it/{$image[1]}x{$image[2]}/ffd602/000000";
}
return $image;