Skip to content

Instantly share code, notes, and snippets.

View Omranic's full-sized avatar

Abdelrahman Omran Omranic

View GitHub Profile
@Omranic
Omranic / vivvo3-vb3-db-migrate.php
Created April 3, 2012 18:27
Simple old code for migrating Vivvo3 to vB3 DB - Run inside vB3
<?php
// ###################### Start Importing Vivvo User #######################
if ($_REQUEST['do'] == 'vivvousers')
{
if (empty($vbulletin->GPC['perpage']))
{
$vbulletin->GPC['perpage'] = 1000;
}
echo '<p>Importing Vivvo Users</p>';
@Omranic
Omranic / gist:3728428
Created September 15, 2012 15:15
Extract all PHP packages, delete compressed files, do something manual, re-compress again
for %%X in ("D:\binary\php\*.tar.gz") do "C:\Program Files\7-Zip\7z.exe" x "%%X" -o"D:\binary\php\"
for %%X in ("D:\binary\php\*.tar") do "C:\Program Files\7-Zip\7z.exe" x "%%X" -o"D:\binary\php\"
del "D:\binary\php\*.tar.gz","D:\binary\php\*.tar"
REM # for /d %%X in ("D:\binary\php\*") do "c:\Program Files\7-Zip\7z.exe" a -ttar "%%X.tar" "%%X\"
REM # for %%X in ("D:\binary\php\*.tar") do "c:\Program Files\7-Zip\7z.exe" a -tgzip "%%X.gz" "%%X"

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@Omranic
Omranic / slugify.js
Last active February 26, 2019 13:07 — forked from demoive/slugify.js
/**
* Converts a string to a "URL-safe" slug.
* Allows for some customization with two optional parameters:
*
* @param {string} Delimiter used. If not specified, defaults to a dash "-"
* @param {array} Adds to the list of non-alphanumeric characters which
* will be converted to the delimiter. The default list includes:
* ['–', '—', '―', '~', '\\', '/', '|', '+', '\'', '‘', '’', ' ']
*/
if (!String.prototype.slugify) {
@Omranic
Omranic / command.sh
Created October 2, 2015 19:03 — forked from sponomarev/command.sh
Remove iTerm2 icon from Dock
# remove
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist
# restore
/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/iTerm.app/Contents/Info.plist
@Omranic
Omranic / gist:86760e5b1e1fa2ff1610
Created October 3, 2015 11:26 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@Omranic
Omranic / googleforms2slack.gs
Created March 26, 2016 01:51 — forked from andychase/googleforms2slack.gs
Google Forms Slack Notification
// Google Forms Slack Notification
// Andy Chase <github.com/andychase>
// License: CC0 1.0 Universal <creativecommons.org/publicdomain/zero/1.0>
// Install 1: This code goes in ( tools > script editor... ) of your google docs form
// Install 2: ( resources > current project triggers ) ( [onSubmit], [from Form], [On form submit] )
// Setup 1: Put your slack api url below
var POST_URL = "https://hooks.slack.com/services/";
function onSubmit(e) {
@Omranic
Omranic / GIF-Screencast-OSX.md
Created April 7, 2016 16:54 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@Omranic
Omranic / meta-tags.md
Created June 17, 2016 22:59 — forked from jaigouk/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@Omranic
Omranic / RepositoryContract.php
Last active June 25, 2016 23:06
Active Repository
<?php
interface RepositoryContract
{
public function find($id, $columns = ['*'], $with = []);
public function findBy($attribute, $value, $columns = ['*'], $with = []);
public function findAll($columns = ['*'], $with = []);