Skip to content

Instantly share code, notes, and snippets.

🌴
Crafting

Gal Bracha rootux

🌴
Crafting
View GitHub Profile
@rootux
rootux / doocrate-clean-mails.py
Last active Nov 27, 2019
Clean gal.b@gmail.com to be galb@gmail.com
View doocrate-clean-mails.py
# Takes an emails.csv file and output it without any '.'
# run with python3 doocrate-clean-mails.py > cleaned_emails.txt
# also remember to concat the original emails to this output
import csv
with open('emails.csv') as csv_file:
emails = csv.reader(csv_file, delimiter=',')
line_count = 0
for email in emails:
if(email[0].endswith("@gmail.com")):
View gist:01ee6c776a4bd77d72349ed59a0a1a6a
import requests
# In a parallel universe we use import string string.printable
CHARACTERS = "abcdefghijklmnopqrstuvwxyz0123456789"
URL = "http://XX.YYY.ZZZ.XX:8070/auth/v1_1"
HEADERS = {'User-Agent' : 'ed9ae2c0-9b15-4556-a393-23d500675d4b', 'content-type' : 'application/json; charset=utf-8' }
PAYLOAD ={}
DISCOVERED_PASSWORD = "f"
def check(chars):
print('---')
@rootux
rootux / imagemagick.rb
Last active Apr 24, 2019
Fixing imagemagick perl issue
View imagemagick.rb
class Imagemagick < Formula
desc "Tools and libraries to manipulate images in many formats"
homepage "https://www.imagemagick.org/"
# Based on https://raw.githubusercontent.com/Homebrew/homebrew-core/6f014f2b7f1f9e618fd5c0ae9c93befea671f8be/Formula/imagemagick.rb
# Please always keep the Homebrew mirror as the primary URL as the
# ImageMagick site removes tarballs regularly which means we get issues
# unnecessarily and older versions of the formula are broken.
url "https://dl.bintray.com/homebrew/mirror/imagemagick-6.9.7-3.tar.xz"
mirror "https://www.imagemagick.org/download/ImageMagick-6.9.7-3.tar.xz"
sha256 "801767344b835b810a5f88c26f062f0fa01a97264dfe9bf5e5adf59a0b5c91a1"
@rootux
rootux / latest_pr.sh
Created Jan 18, 2019
Getting latest closed pr commit messages
View latest_pr.sh
#!/bin/sh
# Output github Pull Requests into a file
cmd="hub pr list -s closed -L 15 --format='%uD %H %t %b %n============%n'";
tempfile=~/tmp.txt;
echo '------======IOS=====-------' > $tempfile
cd ~/Documents/projects/project/ios/
eval $cmd >> $tempfile
echo '------======Backend=====-------' >> $tempfile
cd ~/Documents/projects/project/backend/
eval $cmd >> $tempfile
@rootux
rootux / playing_with_processes.py
Last active Jan 7, 2019
Playing with processes (Helping a brother out)
View playing_with_processes.py
import os
import sys
import random
import time
import tempfile
from datetime import datetime
from multiprocessing import Process
from utils import is_number
@rootux
rootux / mwt.py
Last active Jun 12, 2018 — forked from jh0ker/mwt.py
Memoize-with-timeout decorator
View mwt.py
#!/usr/bin/env python
# Source: http://code.activestate.com/recipes/325905-memoize-decorator-with-timeout/#c1
import time
class MWT(object):
"""Memoize With Timeout"""
_caches = {}
_timeouts = {}
View keybase.md

Keybase proof

I hereby claim:

  • I am rootux on github.
  • I am galbracha (https://keybase.io/galbracha) on keybase.
  • I have a public key ASAjFQA1sDcEyyV_SfAQ3CVI7oMFer64JSeTSh2zcnJY_wo

To claim this, I am signing this object:

@rootux
rootux / firestore.rules
Created Oct 5, 2017
Firestore rules for TEAL based task app
View firestore.rules
service cloud.firestore {
match /databases/{database}/documents {
function isAdmin() {
return exists(/databases/$(database)/documents/admins/$(request.auth.uid));
}
function isUserAssigneeOrCreator() {
return request.auth.uid == resource.assignee.id
|| request.auth.uid == resource.creator.id;
@rootux
rootux / code.gs
Created Sep 18, 2017
Google Apps Script Undo function
View code.gs
/**
* Test function for onEdit. Passes an event object to simulate an edit to
* a cell in a spreadsheet.
* Check for updates: https://stackoverflow.com/a/16089067/1677912
*/
function test_onEdit() {
onEdit({
user : Session.getActiveUser().getEmail(),
source : SpreadsheetApp.getActiveSpreadsheet(),
range : SpreadsheetApp.getActiveSpreadsheet().getActiveCell(),
@rootux
rootux / bash_profile
Last active Nov 16, 2019
my Git ~./bash_profile and some more
View bash_profile
alias gcd='git checkout development'
alias gc='git checkout'
alias gcb='git checkout -b'
alias gs='git status'
alias gb='git branch'
alias gcm='git checkout master'
alias gp='git pull'
alias gl='git log --oneline --decorate --graph'
alias gbdl='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
You can’t perform that action at this time.