Skip to content

Instantly share code, notes, and snippets.

View alash3al's full-sized avatar

Mohammed Al Ashaal alash3al

View GitHub Profile
Resolution Bitrate Framerate
416 x 234 145 ≤ 30 fps
640 x 360 365 ≤ 30 fps
768 x 432 730 ≤ 30 fps
768 x 432 1100 ≤ 30 fps
960 x 540 2000 same as source
1280 x 720 3000 same as source
1280 x 720 4500 same as source
1920 x 1080 6000 same as source
1920 x 1080 7800 same as source
@alash3al
alash3al / Magento2.md
Created October 23, 2017 12:33 — forked from JeansBolong/Magento2.md
Magento2 CheatSheet

Magento 2 tutorial

http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/bk-frontend-dev-guide.html
https://www.creare.co.uk/blog/magento/theming-in-magento-2-part-1
https://www.creare.co.uk/blog/magento/theming-in-magento-2-part-2
http://alanstorm.com/category/magento-2/

I have installed Magento 2 successfully, but icons are not displaying and not able to click anywhere in backend.

Please try running following command.

@alash3al
alash3al / gist:4671c476823f97b4d1f664d5a236236e
Created October 18, 2017 08:40 — forked from piotrekkaminski/gist:9bc45ec84028611d621e
How to automatically download patches and release of Magento
1) First you need to generate download token. Login to your account on magento.com and generate it in Account Settings->Downloads Access Token
2) You will need your MAGEID as well. It is shown at the top-left in your account page.
3) curl -k https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/info/help
4) Profit!
@alash3al
alash3al / gist:b4a93e5f20622bf6655541f03ea78501
Created January 26, 2017 10:04 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@alash3al
alash3al / google_speech2text.md
Created February 28, 2016 20:57 — forked from alotaiba/google_speech2text.md
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@alash3al
alash3al / gist:d1513cdc6d6d6f690295
Created December 31, 2015 04:08 — forked from orangexception/gist:1301150
Minify JavaScript Regular Expression

Notice

Do not run this against minified JavaScript packages. The minified packages often rely on line returns to execute correctly.

This regular expression was designed to minify simple JavaScript.

Regular Expression

(?s)[\t\r\n]|[ ][ ]+|/\*.*?\*/*

I put spaces in square brackets as a reminder that they exist. Spaces can be important. For example, $( "#foo #bar" ) should not become $("#foo#bar"). However, we do want to remove spaces if they are used for indentation.

Why objects (usually) use less memory than arrays in PHP

This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)

The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?

The key here is that objects usually have a predefined set of keys, whereas arrays don't:

@alash3al
alash3al / uri.js
Last active August 29, 2015 14:15 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"