Skip to content

Instantly share code, notes, and snippets.

View osule's full-sized avatar
✝️
ecce homo

Oluwafemi Sule osule

✝️
ecce homo
View GitHub Profile
@fscm
fscm / install_tree.md
Last active February 28, 2024 12:15
[macOS] Install 'tree' command from source

[macOS] Install 'tree' command from source

Instructions on how to install the tree command on macOS from source.

Prerequisites

macOS Command Line Tools need to be installed on your local computer.

To install the Command Line Tools run the following command:

@bachwehbi
bachwehbi / write_fast_2_s3.py
Last active August 29, 2021 15:07
Simple approach to accelerate writing to S3 from Spark.
import base64
import os
import time
"""
Writing from Spark to S3 is ridiculously slow. This is because S3 is an object
store and not a file system. Because of consistency model of S3, when writing
Parquet (or ORC) files from Spark. Data will be stored to a temporary destination
then renamed when the job is successful. As S3 is an object store, renaming files
is very expensive (complete rewrite). The Spark job will only terminate when all
@daehli
daehli / VSCODE.md
Created December 18, 2017 19:51
Install Visual Studio Code on Mac OS and add vscode alias

Brew Install

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null

Install Brew Visual-Studio Code

brew cask install visual-studio-code
@junsionzhang
junsionzhang / install-rsync-macosx.sh
Last active January 7, 2023 02:09
How to install & compile rsync on Mac OSX
#Compile rsync 3.0.7
#Follow these instructions in Terminal on both the client and server to download and compile rsync 3.0.7:
#Download and unarchive rsync and its patches
cd ~/Desktop
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-3.1.2.tar.gz
tar -xzvf rsync-3.1.2.tar.gz
rm rsync-3.1.2.tar.gz
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-patches-3.1.2.tar.gz
@chrisrasco
chrisrasco / 00_nginx_https_rw.config
Created October 3, 2017 13:18
Elastic Beanstalk Extension for forcing https to Docker
files:
"/tmp/45_nginx_https_rw.sh":
owner: root
group: root
mode: "000644"
content: |
#! /bin/bash
CONFIGURED=`grep -c "return 301 https" /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf`
@adamantnz
adamantnz / vwdependencies.sql
Last active February 26, 2024 02:45
Redshift - view table/schema dependencies
CREATE OR REPLACE VIEW dbo.vwdependencies
AS
SELECT DISTINCT c_p.oid AS tbloid
,n_p.nspname AS schemaname
,c_p.relname AS NAME
,n_c.nspname AS refbyschemaname
,c_c.relname AS refbyname
,c_c.oid AS viewoid
FROM pg_class c_p
JOIN pg_depend d_p ON c_p.relfilenode = d_p.refobjid
@leovoel
leovoel / basic_bot.py
Last active January 25, 2024 04:19
discord.py's basic_bot.py converted to use "cogs".
from discord.ext import commands
description = '''An example bot to showcase the discord.ext.commands extension
module.
There are a number of utility commands being showcased here.'''
# this specifies what extensions to load when the bot starts up
startup_extensions = ["members", "rng"]
@john2x
john2x / 00_destructuring.md
Last active June 6, 2024 13:40
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@danharper
danharper / background.js
Last active May 22, 2024 11:09
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});