Skip to content

Instantly share code, notes, and snippets.

View claudiahdz's full-sized avatar
🇲🇽

Claudia Hernández claudiahdz

🇲🇽
View GitHub Profile
'use latest';
const Twitter = require('twit');
const request = require('request');
let client;
let destination = 'destination';
// Generates random integer
const getRandomInt = (min, max) => {
function InsertionSort(arr) {
let len = arr.length, // number of items in the array
value, // the value currently being compared
i, // index into unsorted section
j; // index into sorted section
for(i = 1; i < len; i++) {
// store the current value because it may shift later
// Find a "pivot" element in the array to compare all other
// elements against and then shift elements before or after
// pivot depending on their values
function QuickSort(arr, left = 0, right = arr.length - 1) {
let len = arr.length,
index
if(len > 1) {
index = partition(arr, left, right)
function MergeSort(arr) {
let len = arr.length, // number of items in the array
middle, // middle of the array
left, // left side of the array
right, // right side of the array
// Arrays with 0 or 1 elements don't need sorting
if (len < 2) {
return arr
@claudiahdz
claudiahdz / agnoster-custom.zsh-theme
Last active February 9, 2017 13:01
Custom Agnoster theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AdjustWindowForFontSizeChange</key>
<true/>
<key>AllowClipboardAccess</key>
<false/>
<key>AnimateDimming</key>
<false/>
@claudiahdz
claudiahdz / prepare-commit-msg
Last active February 3, 2017 10:15
prepare-commit-msg
#!/bin/bash
# This way you can customize which branches should be skipped when prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"