Skip to content

Instantly share code, notes, and snippets.

View OrenBochman's full-sized avatar
🏠
Working from home

Oren Bochman OrenBochman

🏠
Working from home
  • WMF
  • 07:21 (UTC +03:00)
View GitHub Profile
@OrenBochman
OrenBochman / gist:43030557ad904d090a4641f4bfd0aca4
Created May 6, 2016 08:18 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@OrenBochman
OrenBochman / introrx.md
Created November 4, 2016 07:55 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@OrenBochman
OrenBochman / TagSpider.py
Created January 9, 2017 11:02 — forked from cspenn/TagSpider.py
GA/GTM Tag Checker in Python and Scrapy
# -*- coding: utf-8 -*-
# Copyright Christopher S. Penn, 2016 | cspenn.com | @cspenn
# This software is licensed under the GNU General Public License, version 3.0.
# Absolutely no warranty or support is provided.
# Run at your own risk.
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
@OrenBochman
OrenBochman / LogUtil.java
Created March 9, 2017 20:46 — forked from dors/LogUtil.java
Cool log util for Android apps that prints each log with the thread, class name and method name from which the log was made
import android.util.Log;
import java.text.MessageFormat;
/*
* Copyright 2015 Dor Sakal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@OrenBochman
OrenBochman / remove-docker-containers.md
Created August 6, 2017 10:19 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@OrenBochman
OrenBochman / new_ubuntu.sh
Created January 17, 2018 21:16 — forked from borfast/new_linux.sh
A script to automatically install as much software as possible for my Ubuntu/Linux Mint development workstation
#!/bin/bash
## Assuming Linux Mint 18. Should also mostly work with Ubuntu 16.04
## Installing .deb packages could be done in a single go if I added the
## necessary repositories beforehand but this way the script is more
## modular and I can comment out any sections if I want to.
## TODO: install Prey
## TODO: Rewrite this with Salt/Ansible?
@OrenBochman
OrenBochman / text2png.py
Created February 7, 2018 22:26 — forked from destan/text2png.py
Python text to image (png) conversion with automatic new line calculation
# coding=utf8
import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
def text2png(text, fullpath, color = "#000", bgcolor = "#FFF", fontfullpath = None, fontsize = 13, leftpadding = 3, rightpadding = 3, width = 200):
REPLACEMENT_CHARACTER = u'\uFFFD'
NEWLINE_REPLACEMENT_STRING = ' ' + REPLACEMENT_CHARACTER + ' '
@OrenBochman
OrenBochman / RuntimePermissionRequest.java
Last active August 21, 2018 07:11 — forked from davidgassner/RuntimePermissionRequest
ask for permission to make a phone call on android
//Add before making a phone call
if (ActivityCompat.checkSelfPermission(
MainActivity.this, Manifest.permission.CALL_PHONE)
!= PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,
Manifest.permission.CALL_PHONE)) {
Toast.makeText(MainActivity.this, "I know you said no, but I'm asking again", Toast.LENGTH_SHORT).show();
}
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.CALL_PHONE},
@OrenBochman
OrenBochman / !!Accelerating_Gradle.md
Last active September 9, 2018 09:36 — forked from kevalpatel2106/gradle.properties
Accelerating Gradle

Accelerating Gradle Builds

@OrenBochman
OrenBochman / Search my gists.md
Last active August 28, 2024 21:07 — forked from santisbon/Search my gists.md
How to search gists

Gist Search Cheatsheet

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:orenbochman

Find all gists with a .yml extension.
extension:yml