Skip to content

Instantly share code, notes, and snippets.

View mrsinguyen's full-sized avatar
🎯
Focusing

Si Nguyen mrsinguyen

🎯
Focusing
View GitHub Profile

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=unknown&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@mrsinguyen
mrsinguyen / gist:9524074
Created March 13, 2014 08:10
Exported module enabled module contrib list with drush
drush pm-list --pipe --type=module --status=enabled --no-core > files/enabled.txt
[14:57][mrsinguyen@nguyen:~/Workspaces/Me]$ git clone https://github.com/ReyzWB/Laravel-4-Modular-Approach.git
Cloning into 'Laravel-4-Modular-Approach'...
remote: Reusing existing pack: 113, done.
remote: Total 113 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (113/113), 37.12 KiB | 0 bytes/s, done.
Resolving deltas: 100% (13/13), done.
Checking connectivity... done.
[14:57][mrsinguyen@nguyen:~/Workspaces/Me]$ cd Laravel-4-Modular-Approach/
[14:57][mrsinguyen@nguyen:~/Workspaces/Me/Laravel-4-Modular-Approach(master)]$ composer
-bash: composer: command not found
@mrsinguyen
mrsinguyen / gist:9828588
Created March 28, 2014 09:11
Y-M-D-H-M-S
define('CMI_YEAR', (365*4+1)/4*24*60*60);
define('CMI_MONTH', (365*4+1)/48*24*60*60);
define('CMI_DAY', 24*60*60);
define('CMI_HOUR', 60*60);
define('CMI_MINUTE', 60);
define('CMI_SECOND', 1);
@mrsinguyen
mrsinguyen / Fundamental Web Development Concepts.md
Created March 30, 2014 01:48
Fundamental Web Development Concepts - 1st week - 30/3/2014
@mrsinguyen
mrsinguyen / diff
Created April 16, 2014 07:53
field_collection_item_load vs field_collection_field_get_entity, please use field_collection_field_get_entity instead of field_collection_item_load
FieldCollectionItemEntity Object
(
[fieldInfo:protected] =>
[hostEntity:protected] =>
[hostEntityId:protected] =>
[hostEntityRevisionId:protected] =>
[hostEntityType:protected] =>
[langcode:protected] => und
[item_id] => 108
[revision_id] => 5340
@mrsinguyen
mrsinguyen / D8Form.php
Created May 11, 2014 03:32
D8Form.php
<?php
/**
* @file
* Contains \Drupal\d8form\Form\D8Form.
*/
namespace Drupal\d8form\Form;
use Drupal\Core\Form\FormBase;
@mrsinguyen
mrsinguyen / d8form.routing.yml
Created May 11, 2014 03:36
d8form.routing.yml
d8form.form:
path: 'd8form'
defaults:
_title: 'Drupal 8 Form'
_form: '\Drupal\d8form\Form\D8Form'
requirements:
_permission: 'access content'
@mrsinguyen
mrsinguyen / D8FormController.php
Created May 11, 2014 03:41
D8FormController.php
<?php
namespace Drupal\d8form\Controller;
use Drupal\Core\Controller\ControllerBase;
class D8FormController extends ControllerBase {
/**
* Demo for d8 form page
<?php
/**
* Implements hook_form_FORM_ID_alter().
*/
function d8form_form_d8form_form_alter(&$form, &$form_state) {
$form['phone_number']['#description'] = t('Start with + and your country code.');
}