Skip to content

Instantly share code, notes, and snippets.

View minademian's full-sized avatar

Mina Demian minademian

View GitHub Profile
@khamidou
khamidou / exponential_backoff.rb
Last active April 21, 2022 13:44 — forked from nathanl/exponential_backoff.rb
Exponential backoff with jitter in Ruby
# Exponential backoff in Ruby
begin
make_request
rescue RequestError => e
if retries <= max_retries
retries += 1
sleep 2 ** retries + rand(20)
retry
else
raise "Timeout: #{e.message}"
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
import { Component, forwardRef, Renderer2, ViewChild } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
export const EPANDED_TEXTAREA_VALUE_ACCESSOR : any = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => TextareaExpandedComponent),
multi: true,
};
@Component({
@geraldvillorente
geraldvillorente / import.md
Created June 14, 2017 05:03
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

@onjin
onjin / docker-compose.yml
Created September 5, 2016 09:17
example docker compose for postgresql with db init script
postgres:
image: postgres:9.4
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
@rafaeltuelho
rafaeltuelho / openshift-cheatsheet.md
Last active March 21, 2024 12:38
My Openshift Cheatsheet

My Openshift Cheatsheet

Project Quotes, Limits and Templates

  • Cluster Quota
oc create clusterquota env-qa \
    --project-label-selector environment=qa \
    --hard pods=10,services=5
    
oc create clusterquota user-qa \
@leoforney
leoforney / install icu4c
Last active June 24, 2017 21:51
Installing icu4c (AKA libicu) on dreamhost
#!/bin/shell
echo "Hey, I heard you want to install libicu on Dreamhost... Let me help you out! :D"
if [ ! -d "$HOME/usr/local" ]; then
mkdir -p ~/usr/local
fi
if [ -d "$HOME/icu" ]; then
echo "Removing the folder ~/icu..."
@staltz
staltz / introrx.md
Last active March 29, 2024 06:13
The introduction to Reactive Programming you've been missing
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active March 23, 2024 08:34
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@JamieMason
JamieMason / unfollow.js.md
Last active March 27, 2024 23:16
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//