Skip to content

Instantly share code, notes, and snippets.

View TamerShlash's full-sized avatar

Tamer Shlash TamerShlash

View GitHub Profile
@TamerShlash
TamerShlash / clean-refs.sh
Created December 12, 2017 09:39
Delete all Merge Requests references.
git for-each-ref refs/merge-requests/*/head --format='%(refname)' | \
while read ref
do
git update-ref -d $ref
done
@TamerShlash
TamerShlash / rspec_model_testing_template.rb
Created November 30, 2015 04:37 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@TamerShlash
TamerShlash / amavisd-new-courier.patch
Last active August 29, 2015 14:11
Amavisd Courier Patch for Amavisd Version 2.10.1 and Courier Version 0.73.2
--- amavisd.ori 2014-12-21 19:49:24.757834955 +0200
+++ amavisd 2014-12-21 20:58:38.581469101 +0200
@@ -107,7 +107,7 @@
# Amavis::Lookup::LDAPattr (the rest)
# Amavis::In::AMPDP
# Amavis::In::SMTP
-#( Amavis::In::Courier )
+# Amavis::In::Courier
# Amavis::Out::SMTP::Protocol
# Amavis::Out::SMTP::Session
@TamerShlash
TamerShlash / facebook-auto-delete-set-of-group-members.js
Last active August 29, 2015 14:07 — forked from michaelv/facebook-mass-delete-group-members.js
This JavaScript removes a specified set of Facebook group members. Tested with Google Chrome on 10/10/2014. PLEASE READ the Usage section in the file. Known issues: 1) When Facebook responds slowly, the script might experience hickups 2) Occasionally, the error 'this user is not a member of the group' pops up.
/* Slightly customized version of https://gist.github.com/michaelv/11145168
Usage:
1. Put the IDs you want to remove in the globalToBeRemoved array, and make sure
they are strings
2. Go to the group's members page (https://www.facebook.com/groups/GID/members/)
3. Paste the code (after adding the IDs to globalToBeRemoved) In the Javascript
console, and then wait until the work is done. It takes a reasonable time.
*/
var globalToBeRemoved = ["10000152515xxxx","10000152515xxxx"];
@TamerShlash
TamerShlash / oracle_java8_installer.sh
Last active August 27, 2016 12:05
Install Oracle Java 8 on Ubuntu from Syria (or if Oracle blocks you)
# 1. Use a PROXY and go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and accept the terms then download the tar.gz suitable to your system (32 or 64 bit).
# 2. Move that .tar.gz tarball to the Downloads directory in your home folder.
# 3. run this script as sudo
if [[ $UID != 0 ]]; then
echo "This script neeeds to be run with sudo, like this:"
echo -e "\n sudo $0 $*\n"
exit 1
fi
apt-get install python-software-properties
@TamerShlash
TamerShlash / devise.ar.yml
Last active June 30, 2017 14:43
Arabic translations for Devise v2.2.4
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
ar:
devise:
confirmations:
confirmed: "لقد تم تأكيد حسابك بنجاح، وتم تسجيل دخولك."
send_instructions: "ستصلك خلال دقائق رسالة على بريدك الإلكتروني تتضمن الخطوات اللازمة لتأكيد حسابك."
send_paranoid_instructions: "إذا كان بريدك الإلكتروني مسجلاً عندنا فستصل إليه خلال دقائق رسالة تتضمن الخطوات اللازمة لتأكيد حسابك."
failure:
already_authenticated: "تم تسجيل دخولك مسبقاً."