Skip to content

Instantly share code, notes, and snippets.

Avatar

Emil Mohamed emohamed

View GitHub Profile
@emohamed
emohamed / check.js
Last active Jan 29, 2021 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
View check.js
const legit = require('legit');
const fs = require('fs');
const async = require('async');
let jsonString = fs.readFileSync('./email-providers.json');
let domains = JSON.parse(jsonString);
const valid = [];
const invalid = [];
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

View acf-assets.js
(function($, undefined){
// vars
var blocks = {};
var onChangeTimeout = 0;
var isSerializing = false;
// WP vars
var el = wp.element.createElement,
Fragment = wp.element.Fragment,
View carbon-fields-block.php
<?php
Container::make( 'block', 'Flight Details' )
->add_fields( [
Field::make( 'text', 'crb_from', 'From' ),
Field::make( 'text', 'crb_to', 'To' ),
Field::make( 'date_time', 'crb_departure_time', 'Departure Time' ),
Field::make( 'date_time', 'crb_arrival_time', 'Arrival Time' ),
Field::make( 'text', 'crb_duration', 'Duration' ),
])
->set_block_render_function(function ($flight) {
View gist:584c50372b9ea6f83dabb9dfcf79a9a4
### Keybase proof
I hereby claim:
* I am emohamed on github.
* I am emohamed (https://keybase.io/emohamed) on keybase.
* I have a public key ASDJJT9RHt6htVTvMKe4J7kICygH4_4HKGpCCCAcWcLcRAo
To claim this, I am signing this object:
@emohamed
emohamed / gist:d452fca0d1da36e5eef64e6bf73ea95e
Last active Nov 9, 2016
Sublime Text 2 - Useful Shortcuts
View gist:d452fca0d1da36e5eef64e6bf73ea95e

Sublime Text – Shortcuts

Navigation

Combine those with shift for selecting text simultaneously

Ctrl+→ / Ctrl+← Go to the end / start of the word
End / Home Go to the end / beginning of the line
Ctrl+End / Ctrl+Home Go to the end / beginning of the file
Alt+→ / Alt+← Go to the end / beginning of the sub-word
View fields.php
<?php
use Carbon_Fields\Container\Container;
use Carbon_Fields\Field\Field;
$general_block = [
Field::make('text', 'plain_text_block'),
Field::make('rich_text', 'rich_text_block'),
];
$media_block = [
@emohamed
emohamed / 0_reuse_code.js
Created Nov 18, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View Carbon_Group.php
<?php
Carbon_Field::register_namespace('location', function ($type, $name, $label) {
return Carbon_Field::factory($type, $name, $label)
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'crb_user_location_type',
'value' => 'fixed',
'compare' => '=',
View gist:1117a1bada3a65809f50
Carbon Fields use Underscore template engine. Each field has a `template` method that prints the underscore template code.
```
class Carbon_Field_Example extends Carbon_Field {
// Base template
function template() {
?>
<input id="{{{ id }}}" type="text" name="{{{ name }}}" value="{{ value }}" class="regular-text example-field" />
<span>This is an example field. </span>
<?php