Skip to content

Instantly share code, notes, and snippets.

View obahareth's full-sized avatar
🧉
In the Zone

Omar Bahareth obahareth

🧉
In the Zone
View GitHub Profile
package com.deviant.security.shield;
public final class BuildConfig {
public static final String BUILD_TYPE = "debug";
public static final boolean DEBUG;
public static final String FLAVOR = "";
public static final String PACKAGE_NAME = "com.deviant.security.shield";
public static final int VERSION_CODE = 4;
public static final String VERSION_NAME = "2.2";
/* Taken zigmob's (http://forums.macrumors.com/showthread.php?t=1742566) workaround a step further
And added some triggers to clean up these dodgy character combinations (ff, fi, fl).
Still crashes on initial message read but saves having to manually run the sql query eve time a message contains the character combinations */
-- Working well for me so far --
CREATE TRIGGER insert_Ff AFTER INSERT ON ZWAMESSAGE
BEGIN
UPDATE ZWAMESSAGE
SET ZTEXT = replace( ZTEXT, 'ff', 'f f')
WHERE ZWAMESSAGE.ZTEXT like '%ff%';
@obahareth
obahareth / 0_reuse_code.js
Created August 29, 2014 07:36
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@obahareth
obahareth / Directions
Last active January 2, 2016 09:09 — forked from ebinnion/.m file
Declare an array that will hold the coordinates within the viewDidLoad function/method. Then fill the array with the coordinates. Then define a MKPolygon pointer that will use that array. Last, add the overlay to the map.
@obahareth
obahareth / Gemfile
Created January 26, 2017 21:05 — forked from goncalvesjoao/Gemfile
Changes you need to make in order to make Devise use JWT Header Authentication
# Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile"
gem 'jwt'
@obahareth
obahareth / dark.md
Created December 25, 2018 10:55 — forked from a7madgamal/dark.md
Dark mode for Slack on MacOS
  1. Close slack
  2. Open this file /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
  3. Append this to it
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css',
   success: function(css) {
 $("").appendTo('head').html(css);
@obahareth
obahareth / Gemfile
Created July 5, 2020 10:58 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@obahareth
obahareth / README-container-as-systemd-service.md
Created August 15, 2022 06:31 — forked from drmalex07/README-container-as-systemd-service.md
Wrap a docker container in a systemd service. #docker #systemd.service #systemd #cgroups

README

Suppose we want to wrap a container running a Redis instance as a service.

Override unit file for docker daemon

We must override the service unit file that ships with docker (under /lib/systemd/system) in order to pass some cgroup-related options to the docker daemon. So, following the usual method to override parts of a unit file, we create the file /etc/systemd/system/docker.service.d/10-service.conf with contents:

@obahareth
obahareth / squid_proxy_tutorial.md
Created August 15, 2022 10:37 — forked from jackblk/squid_proxy_tutorial.md
Tutorial on how to setup a squid proxy with authentication.

Note

This tutorial is for Ubuntu & Squid3. Use AWS, Google cloud, Digital Ocean or any services with Ubuntu to follow this tutorial.

Install squid & update

sudo apt-get update
sudo apt-get install squid3
sudo apt-get install apache2-utils
@obahareth
obahareth / main.yaml
Created August 24, 2022 13:00 — forked from ArturT/main.yaml
GitHub Actions - how to run parallel tests in RSpec for Ruby on Rails project. See article how to run RSpec on GitHub Actions for Ruby on Rails app using parallel jobs https://docs.knapsackpro.com/2019/how-to-run-rspec-on-github-actions-for-ruby-on-rails-app-using-parallel-jobs or sign up at https://knapsackpro.com/?utm_source=github&utm_medium=…
# .github/workflows/main.yaml
name: Main
on: [push]
jobs:
test:
runs-on: ubuntu-latest
# If you need DB like PostgreSQL, Redis then define service below.