This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff -u <(drush @project-local pm-list | grep Enabled) <(drush @project-remote pm-list | grep Enabled) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Normal patch. | |
| git diff 7.x-1.x > [project_name]-[short-description]-[issue-number]-[comment-number].patch | |
| # Interdiff patch. | |
| git diff old_patch_branch > interdiff-[issue-number]-[old-patch-comment-number]-[comment-number].diff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| drush rsync @project-local:%files @project-remote:%files | |
| drush rsync @project-local:%private @project-remote:%private | |
| drush sql-sync @project-local @project-remote |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| drush rsync @project-remote:%files @project-local:%files | |
| drush rsync @project-remote:%private @project-local:%private | |
| drush sql-sync @project-remote @project-local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env drush | |
| $result = db_query("SELECT id, data from field_config where type = 'field_collection'"); | |
| foreach ($result as $field) { | |
| $data = unserialize($field->data); | |
| $data['indexes'] = array('revision_id' => array('revision_id')); | |
| $data = serialize($data); | |
| db_query("update field_config set data = :data where id = :id", array(':data' => $data, ':id'=> $field->id)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Console\Commands; | |
| use Illuminate\Console\Command; | |
| use Mail; | |
| class EmailCommand extends Command | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this function will work cross-browser for loading scripts asynchronously | |
| function loadScript(src) { | |
| return new Promise(function(resolve, reject) { | |
| const s = document.createElement('script'); | |
| let r = false; | |
| s.type = 'text/javascript'; | |
| s.src = src; | |
| s.async = true; | |
| s.onerror = function(err) { | |
| reject(err, s); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| # ... | |
| # handle OPTIONS requests from window.fetch | |
| if ($request_method = OPTIONS ) { | |
| add_header Access-Control-Allow-Origin "*"; | |
| add_header Access-Control-Allow-Methods "GET, OPTIONS"; | |
| add_header Access-Control-Allow-Headers "Authorization,content-type"; | |
| add_header Access-Control-Allow-Credentials "true"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Use this if you need to recreate `uniqid` in another language | |
| * From: http://php.net/manual/en/function.uniqid.php#95001 | |
| */ | |
| // time in microseconds as float | |
| $m = microtime(true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Start from a Debian image with the latest version of Go installed | |
| # and a workspace (GOPATH) configured at /go. | |
| FROM golang | |
| # Copy the local package files to the container's workspace | |
| ADD . /go/src/github.com/username/program | |
| # bake in some environment variables? | |
| # ENV SOME_ENV "" |