Skip to content

Instantly share code, notes, and snippets.

View OsamaShabrez's full-sized avatar
💭
Turning ☕ and 🍕 into software 🤓

Osama Shabrez OsamaShabrez

💭
Turning ☕ and 🍕 into software 🤓
View GitHub Profile
@OsamaShabrez
OsamaShabrez / MyTemporaryPlugin.php
Created January 3, 2015 18:35
A temporary Plugin I created to keep small php snippets independent of theme functions.php file
<?php
/**
* Plugin Name: MyTemporaryPlugin
* Plugin URI: http://OsamaShabrez.com
* Description: This is small temporary plugin created to keep small php codes idependent of theme or other plugin files
* Version: 1.0.1
* Author: Muhammad Osama Shabrez
* Author URI: http://OsamaShabrez.com
* Network: false
* License: GPL2
@OsamaShabrez
OsamaShabrez / _flash_messages.html.erb
Created January 19, 2015 11:14
Rails flash message using Twitter Bootstrap 3
<% flash.each do |type, message| %>
<div class="alert <%= alert_class_for(type) %> alert-dismissable fade in">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<%= message %>
</div>
<% end %>
@OsamaShabrez
OsamaShabrez / show-hide-files-osx
Created March 12, 2015 17:49
Quickly show/hide hidden files in mac osx
Open a terminal and paste this command
defaults write com.apple.finder AppleShowAllFiles YES
Press return and relaunch finder
To hide these files again follow the same steps replaing terminal
command with
defaults write com.apple.finder AppleShowAllFiles NO
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@OsamaShabrez
OsamaShabrez / ResetLaunchpadIconSize
Created March 25, 2016 11:45
How To Change Launchpad Icon Size in OS X
# to update columns
defaults write com.apple.dock springboard-columns -int <number / 9>
# to update rows
defaults write com.apple.dock springboard-rows -int <number / 5>
# reset dock icons to default positions
defaults write com.apple.dock ResetLaunchPad -bool TRUE
# restart dock

Keybase proof

I hereby claim:

  • I am osamashabrez on github.
  • I am osamashabrez (https://keybase.io/osamashabrez) on keybase.
  • I have a public key ASBw7263VVpHDxYQSzZb2x3rFrV0_RdN113wegCira0whgo

To claim this, I am signing this object:

@OsamaShabrez
OsamaShabrez / gpg-agent.conf
Created September 22, 2016 13:23
GPG Config
pinentry-program /usr/local/bin/pinentry-mac
@OsamaShabrez
OsamaShabrez / autoexec.cfg
Created June 17, 2017 15:50
CSGO Config File
// Rates
rate "307200"
cl_cmdrate "128"
cl_updaterate "128"
cl_interp "0.0"
cl_interp_ratio "1"
cl_interpolate "1"
cl_lagcompensation "1"
net_client_steamdatagram_enable_override "1" // SDR beta
@OsamaShabrez
OsamaShabrez / bash_aliases
Created August 3, 2018 13:41
Install PHP7.1 + Nginx + MySQL on macOS Sierra
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.restart='mysql.stop && mysql.start'
@OsamaShabrez
OsamaShabrez / countries-with-iso.sql
Last active November 10, 2023 18:01
SQL Query to create a Countries table and insert all countries with their ISO
CREATE TABLE `Countries` (
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`NAME` CHAR(100) NOT NULL UNIQUE,
`ISO` CHAR(2) NOT NULL UNIQUE
);
INSERT INTO Countries (Name, ISO) VALUES ('Afghanistan', 'AF');
INSERT INTO Countries (Name, ISO) VALUES ('Albania', 'AL');
INSERT INTO Countries (Name, ISO) VALUES ('Algeria', 'DZ');
INSERT INTO Countries (Name, ISO) VALUES ('American Samoa', 'AS');
INSERT INTO Countries (Name, ISO) VALUES ('Andorra', 'AD');