Skip to content

Instantly share code, notes, and snippets.

# Setting the prefix from `C-b` to `C-a`.
# By remapping the `CapsLock` key to `Ctrl`,
# you can make triggering commands more comfottable!
set -g prefix C-a
# Free the original `Ctrl-b` prefix keybinding.
unbind C-b
# Ensure that we can send `Ctrl-a` to other apps.
bind C-a send-prefix
@omarish
omarish / Load_CSV_to_Vertica.md
Last active December 8, 2019 02:44
Quick primer on loading a large CSV file into a Vertica Database.

Load a Large CSV into Vertica

Here's an efficient way to load a dataset into Vertica by splitting it up into multiple pieces and then parallelizing the load process.

Note that this only makes sense if your Vertica cluster is a single node. If it's running more nodes, there are definitely more efficient ways of doing this.

For this example, the large CSV file will be called large_file.csv. If your file is under 1GB, it probably makes sense to load it using a single COPY command.

Dear Client:

We are writing to share with you important information about a security compromise involving a database containing some of your personal information, as well as steps we are taking in response, and the resources we are making available to you.

What Happened

Federal law enforcement officials recently informed us that they’ve been investigating cybersecurity crimes involving the theft of information from Scottrade and other financial services companies. We immediately initiated a comprehensive response.

Based upon our subsequent internal investigation coupled with information provided by the authorities, we believe a list of client names and street addresses was taken from our system. Importantly, we have no reason to believe that Scottrade’s trading platforms or any client funds were compromised. All client passwords remained encrypted at all times and we have not seen any indication of fraudulent activity as a result of this incident.

Keybase proof

I hereby claim:

  • I am omarish on github.
  • I am obb (https://keybase.io/obb) on keybase.
  • I have a public key ASDIeAVpKvwV3vCq56hv4VTRXv_wNzmDUIvvTUJiMJwrhwo

To claim this, I am signing this object:

import mutations
class UserSignup(mutations.Mutation):
name = mutations.fields.CharField()
email = mutations.fields.CharField()
def execute(self):
user = User.objects.create([...])
if user.is_referred_through_partner:
[...]
import mutations
class UserSignup(mutations.Mutation):
"""Sign up the user if and only if their name is a palindrome. """
name = mutations.fields.CharField()
email = mutations.fields.CharField()
def validate_name_is_palindrome(self):
"""
Since this method is prefixed with validate_, it's assumed to be
@omarish
omarish / newpost.rb
Last active May 8, 2018 17:47
Script to make a new post in Jekyll.
#!/usr/bin/env ruby
require 'optparse'
options = {
:subdir => "_posts"
}
parsed = OptionParser.new do |opts|
opts.banner = 'Usage: newpost --title "post title" [options]'
@omarish
omarish / clean4.zsh-theme
Created January 28, 2025 20:33
Fast and clean ZSH theme
# Allow command substitution in the prompt
setopt prompt_subst
# Helper function: Show Git branch info as ":branch" (± if dirty)
function prompt_git_info() {
if git rev-parse --is-inside-work-tree &>/dev/null; then
local branch="$(git rev-parse --abbrev-ref HEAD 2>/dev/null)"
# Check for uncommitted changes
if ! git diff --quiet --ignore-submodules HEAD &>/dev/null; then
# Dirty repo: append ±