Skip to content

Instantly share code, notes, and snippets.

View miguelarauj1o's full-sized avatar
🎯
Focusing

Miguel Araujo miguelarauj1o

🎯
Focusing
View GitHub Profile
@staltz
staltz / introrx.md
Last active May 2, 2024 12:31
The introduction to Reactive Programming you've been missing
@jstn
jstn / RandomNumbers.swift
Last active May 5, 2023 03:26
generate random numbers for 64-bit types while mitigating modulo bias
/*
`arc4random_uniform` is very useful but limited to `UInt32`.
This defines a generic version of `arc4random` for any type
expressible by an integer literal, and extends some numeric
types with a `random` method that mitigates for modulo bias
in the same manner as `arc4random`.
`lower` is inclusive and `upper` is exclusive, thus:
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@romainl
romainl / gist:9970697
Last active March 21, 2024 09:00
How to use Tim Pope's Pathogen

How to use Tim Pope’s Pathogen

I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.

The idea

Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.

This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.

@mattt
mattt / BCP47LanguageCodeForString.m
Last active April 21, 2018 08:45
Detect ISO 681 Language Code from String and Convert to BCP 47 Language Code
static NSString * BCP47LanguageCodeFromISO681LanguageCode(NSString *ISO681LanguageCode) {
if ([ISO681LanguageCode isEqualToString:@"ar"]) {
return @"ar-SA";
} else if ([ISO681LanguageCode hasPrefix:@"cs"]) {
return @"cs-CZ";
} else if ([ISO681LanguageCode hasPrefix:@"da"]) {
return @"da-DK";
} else if ([ISO681LanguageCode hasPrefix:@"de"]) {
return @"de-DE";
} else if ([ISO681LanguageCode hasPrefix:@"el"]) {
@robertoaloi
robertoaloi / kill-erlang-node.sh
Created February 8, 2014 13:55
Kill an Erlang process by node name
#!/usr/bin/env bash
# Kill an Erlang process by node name
#
# e.g.: kill-erlang-node kred
# Check usage
if [ -z "$1" ]; then
echo "Usage: `basename $0` NODE_NAME"
exit 1
@gitaarik
gitaarik / git_submodules.md
Last active May 1, 2024 12:25
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 2, 2024 12:46
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@gmccreight
gmccreight / master.vim
Last active September 23, 2023 08:41
A script that gives you a playground for mastering vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@zenorocha
zenorocha / .hyper.js
Last active November 12, 2023 15:13 — forked from millermedeiros/osx_setup.md
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks