Planet Drupal

Syndicate content - aggregated feeds in category Planet Drupal
Updated: 37 min 45 sec ago

Flocon de toile | Freelance Drupal: Drupal SA-CORE-2014-005, perspective and lessons

Fri, 11/28/2014 - 10:28
div class=field field-name-field-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image src= width=800 height=300 alt=photo d#039;un phare //div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedp On Wednesday, October 15, 2014, the Drupal Security Team published an highly critical security advisory (reference SA-CORE-2014-005 (CVE-2014-3704)) in regard of a vulnerability discovered in the database abstraction API that allows to automatically sanitize the parameters of an SQL query and, therefore,prevent SQL injection attacks. In short, this vulnerability allows an anonymous attacker to compromise any Drupal 7 site by a SQL injection attack. Let's go back on the chronology of the event and try to learn some lesson from the discovery and the management of this security breach. /p /div/div/divdiv class=field field-name-field-theme field-type-taxonomy-term-reference field-label-abovediv class=field-labelThèmenbsp;/divdiv class=field-itemsdiv class=field-item evenDrupal planet/div/div/div

Lullabot: Drupal Community Leadership

Fri, 11/28/2014 - 10:05
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpIn this week's episode, a href= Berry/a is joined by Larry Garfield (a href=, Greg Dunlap (a href=, and Gábor Hojsty (a href=ábor Hojsty/a) to discuss the ongoing public conversation about Drupal's Community Leadership pains./p/div/div/div ul class=field field-name-field-show-notes field-type-link-field field-label-hidden li a href='s Managing Complexity presentation/a /li li a href=ábor's On Authority blog post/a /li li a href='s Stay for the Community blog post/a /li li a href='s collection of the discussion to date/a /li li a href= Vettes’ D8 Lessons Learned presentation/a /li li a href=’ DrupalCon Amsterdam keynote/a /li li a href= Welchman keynote, The Paradox of Open Growth/a /li li a href= Community Working Group/a /li li a href= Painting The Bikeshed: Lessons From A Drupal 8 Initiative Owner presentation/a /li li a href= Making Core Development More Sustainable presentation/a /li /ul

Flocon de toile | Freelance Drupal: Create a Drupal 8 block in seconds

Fri, 11/28/2014 - 08:59
div class=field field-name-field-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image src= width=800 height=300 alt=Blocs de pierres empilées //div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedp We continue to explore the possibilities offered by the Console module and will discover how to build a Drupal 8 block in a very little time, and then customize it to our needs. /p /div/div/divdiv class=field field-name-field-theme field-type-taxonomy-term-reference field-label-abovediv class=field-labelThèmenbsp;/divdiv class=field-itemsdiv class=field-item evenDrupal planet/div/div/div

Code Drop: Getting Started Testing Drush Commands

Fri, 11/28/2014 - 07:53
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpI've recently been rewriting the Drush Migrate Manifest command for Drupal 8 and it was my first introduction to writing tests for Drush commands. The process was more painless than I had initially imagined it would be, but not without a few caveats along the way./p h2Background/h2 pDrush tests use PHPUnit as the test runner and testing framework which offers a kind familiarity to many developers, especially anyone involved in Drupal 8. Drush uses the name Unish for its testing namespace and base test classes. I’ve no idea where Unish comes from but here’s a a href= h2Test Skeleton/h2 pCreate your test within the tests folder using Lower Camel Case for the naming of both the file and the class name./p p /p/div/div/div

KnackForge: Android app integration with Drupal for OAuth

Fri, 11/28/2014 - 07:40
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpWhen you build Android app for an existing Drupal website which allows it's users to login using their social media account, it is important to include such features in your app as well. Instead of using app specific APIs, we can use WebView to achieve the login mechanism. Let me explain the method that I followed,/p p1) Setup Drupal menu paths for social login(s)./p p2) From android app, use webview that can call Drupal path for social login./p p3) Drupal side completes the authentication and sends back an identification token to Android./p p4) Android app uses the token to make further calls to Drupal site. Drupal side authenticates user by this token./p pstrongDrupal side /strong/p pFirst we need to define entry point for social login,/p/div/div/div

.VDMi/Blog: I went to Drupal 7.33 and all I got was a slow site

Thu, 11/27/2014 - 22:29
div class=field field-name-field-afbeelding field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evena href=/blog/i-went-drupal-733-and-all-i-got-was-slow-siteimg style=max-width: 40%; height: auto; float: left; margin-right: 1em; align=left hspace=10 src= width=110 height=110 alt=I went to Drupal 7.33 and all I got was a slow site //a/div/div/divdiv class=field field-name-field-samenvatting1 field-type-text-long field-label-hiddendiv class=field-itemsdiv class=field-item evenSo, you just upgraded your site(s) to Drupal gt;= 7.33, everything seemed fine in your tests. You deployed the new release and after a while you notice that your site isn#039;t as fast as before. It#039;s actually slowing down everything on your server. You started Googling and ended up on this blogpost. Sounds like your story? Read on!/div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpI spent the last 2 hours figuring this out, I decided it would be best to write it up right away while it's fresh in my memory. TLDR; at the bottom of this post./p pWe did an upgrade to Drupal 7.34 recently, we thought everything was fine. Release went over 3 different environments before deploying to live and no actual issues were found./p pAfter deployment to live, we got some reports that the site was responding slow. We didn't directly link it to the upgrade to 7.34, I actually did a diff between 7.32 and 7.34 to see what changed after these reports and did not see anything suspicious that could cause this./p pWe had to investigate after a while as there was no sign of improvement, the CPU of the server was hitting 100% 24/7. New Relic monitoring told us about many calls to the file_scan_directory function of Drupal. When I actually logged the calls with the following snippet:/p p/pprecodestatic $count;br / if (!isset($count)) {br /   $count = 0;br / }br / $count++;br / drupal_debug($count . PHP_EOL);/code/pre pThe count actually went up to 700 for every request (It's quite a large project, plus the file_scan_directory is recursive).br /When I printed the debug_backtrace, I saw that this call was coming from /Looking at the function arguments, Drupal was looking for a imagecache_actions file, why?! And why on every request? Doesn't it cache these records in the registry?!/p pYes it does! It appeared the imagecache_actions module had a typo in it (patch a href= //p precodemodule_load_include('inc', 'imagcache_actions', '');/code/pre pThis should be:br //p precodemodule_load_include('inc', 'imagecache_actions', '');/code/pre pThis would not have been an issue previously, 7.33 introduced a a href= /Pre 7.33:br //p precode$file = db_query(SELECT filename FROM {system} WHERE name = :name AND type = :type, array(':name' =gt; $name, ':type' =gt; $type))-gt;fetchField();br / if (file_exists(DRUPAL_ROOT . '/' . $file)) {br /   $files[$type][$name] = $file;br / }/code/pre p7.33 or higher:br //p precode$file = db_query(SELECT filename FROM {system} WHERE name = :name AND type = :type, array(':name' =gt; $name, ':type' =gt; $type))-gt;fetchField();br / if ($file !== FALSE amp;amp; file_exists(DRUPAL_ROOT . '/' . $file)) {br /   $files[$type][$name] = $file;br / }/code/pre pBefore 7.33, Drupal would try to find the record in the system table, it wouldn't find it and the $file would be NULL. The resulting string would be DRUPAL_ROOT . '/' . $file, as $file is NULL, you can also see it as DRUPAL_ROOT . '/'. Obviously the DRUPAL_ROOT exists, so it returns TRUE. It would put the record in the $files array and continue with what it was doing./p pBecause 7.33 and higher does a NULL-check on $file, it will not add any record to the $files array. This causes it to go into the file discovery routine:br //p precodeif (!isset($files[$type][$name])) {br /   // ... Some codebr /   $matches = drupal_system_listing(/^ . DRUPAL_PHP_FUNCTION_PATTERN . \.$extension$/, $dir, 'name', 0);br /   foreach ($matches as $matched_name =gt; $file) {br /     $files[$type][$matched_name] = $file-gt;uri;br /   }br / }/code/pre pThis code will try to scan your Drupal installation for the given file. It will not find the file and continue eventually, but it will execute the file search in EVERY request that you execute the module_load_include./p pWhile our issue was in the imagecache_actions module, your issue might be in any module (even custom) which does a wrong /It's very hard to find this out yourself. You can edit includes/ on line 866 to write some info away to /tmp/drupal_debug.txt:br /Add the following code after line 866:br //p precodeelse {br /   drupal_debug('Missing file ' . $type . ' ' . $name . ' ' . DRUPAL_ROOT . '/' . $file . PHP_EOL);br / }/code/pre pTLDR; an issue in imagecache_actions combined with an upgrade to Drupal gt;= 7.33 killed the performance of our site. Patch for imagecache_actions a href= Causing issue/patch a href= /div/div/div

Blair Wadman: Eleven tips to keep Drupal up to date with security releases

Thu, 11/27/2014 - 21:36
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpKeeping your Drupal site up to date has always been of critical importance to ensure it remains secure. Last month's announcement of a a href= Injection vulnerability/a and subsequent announcement of a href= attacks within 7 hours/a caused wide spread panic across much of the Drupal community./p/div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/drupal/all typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal/a/divdiv class=field-item odd rel=dc:subjecta href=/drupal/planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Planet Drupal/a/div/div/div

Appnovation Technologies: Searching and attaching images to content

Thu, 11/27/2014 - 18:00
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpBecause of its ability to extend the core platform, Drupal has become a popular CMS/Framework for many large media and publishing companies./p/div/div/divdiv class=field field-name-field-blog-header-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evena href=/blog/searching-and-attaching-images-contentimg typeof=foaf:Image src= width=680 height=200 alt= //a/div/div/divdiv class=sharethis-buttonsdiv class=sharethis-wrapperspan st_url= st_title=Searching and attaching images to content class=st_facebook/span span st_url= st_title=Searching and attaching images to content class=st_twitter/span span st_url= st_title=Searching and attaching images to content class=st_sharethis/span script type='text/javascript'var switchTo5x = false;/scriptscript type='text/javascript' src=''/scriptscript type='text/javascript'stLight.options({publisher:dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683});/script/div/div

Oliver Davies: Include environment-specific settings files on Pantheon

Thu, 11/27/2014 - 17:24
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpI was recently doing some work on a site hosted on a href=http://getpantheon.comPantheon/a and came across an issue, for which part of the suggested fix was to ensure that the code$base_url/code variable was explicitly defined within settings.php (this is also best practice on all Drupal sites)./p pThe way that was recommended was by using a codeswitch()/code function based on Pantheon's environment variable. For example:/p/div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfixh3 class=field-labelTags: /h3ul class=linksli class=taxonomy-term-reference-0a href=/blog/tags/drupal-planetDrupal Planet/a/lili class=taxonomy-term-reference-1a href=/blog/tags/pantheonPantheon/a/lili class=taxonomy-term-reference-2a href=/blog/tags/settingsphpsettings.php/a/lili class=taxonomy-term-reference-3a href=/blog/tags/drupalDrupal/a/li/ul/div

Cheppers blog: Acquia Certified Developer exam - passed!

Thu, 11/27/2014 - 13:21
div class=field field-name-field-front-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item even rel=schema:image resource= href=/blog/acquia-certified-developer-exam-passedimg typeof=foaf:Image src= width=350 height=210 alt= //a/div/div/divdiv class=field field-name-field-lead field-type-text-long field-label-hiddendiv class=field-itemsdiv class=field-item even property=schema:headlinepWe are proud to announce that Cheppers has now three Acquia Certified Developers!br / This Monday Mau, Attila and Andor have all passed the exam held by Acquia, and we are very proud of them./p /div/div/divspan rel=schema:url resource=/blog/acquia-certified-developer-exam-passed class=rdf-meta/spanspan property=schema:name content=Acquia Certified Developer exam - passed! class=rdf-meta/span

Kristian Polso: Crawling the top 15,000 Drupal websites

Thu, 11/27/2014 - 11:01
So I crawled the top 1,000,000 websites from Alexa, looking for all of the Drupal websites (and other popular CMS's). Here are the results.

Joachim's blog: A git-based patch workflow for (with interdiffs for free!)

Thu, 11/27/2014 - 09:39
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpThere's been a lot of discussion about how we need github-like features on Will we get them? There's definitely many improvements in the pipeline to the way our issue queues work. Whether we actually need to replicate github is another debate (and my take on it is that I don't think we do)./p pIn the meantime, I think that it's possible to have a good collaborative workflow with what we have right now on, with just the issue queue and patches, and git local branches. Here's what I've gradually refined over the years. It's fast, it helps you keep track of things, and it makes the most of git's strengths./p h2A word on local branches/h2 pGit's killer feature, in my opinion, is local branches. Local branches allow you to keep work on different issues separate, and they allow you to experiment and backtrack. To get the most out of git, you should be making small, frequent commits./p pWhenever I do a presentation on git, I ask for a show of hands of who's ever had to bounce on CMD-Z in their text editor because they broke something that was working five minutes ago. Commit often, and never have that problem again: my rule of thumb is to commit any time that your work has reached a state where if subsequent changes broke it, you'd be dismayed to lose it./p h2Starting work on an issue/h2 pMy first step when I'm working on an issue is obviously:/p pdiv class=codeblockcodenbsp; git pull/code/div/p pThis gets the current branch (e.g. 7.x, 7.x-2.x) up to date. Then it's a good idea to reload your site and check it's all okay. If you've not worked on core or the contrib project in question in a while, then you might need to run update.php, in case new commits have added updates./p pNow start a new local branch for the issue:/p pdiv class=codeblockcodenbsp; git checkout -b 123456-foobar-is-broken/code/div/p pI like to prefix my branch name with the issue number, so I can always find the issue for a branch, and find my work in progress for an issue. A description after that is nice, and as git has bash autocompletion for branch names, it doesn't get in the way. Using the issue number also means that it's easy to see later on which branches I can delete to unclutter my local git checkout: if the issue has been fixed, the branch can be deleted!/p pSo now I can go ahead and start making commits. Because a local branch is private to me, I can feel free to commit code that's a total mess. So something like:/p pdiv class=codeblockcodenbsp; dpm($some_variable_I_needed_to_examine);br /nbsp; /*br /nbsp; // Commented-out earlier approach that didn't quite work /nbsp; $foo += $bar;br /nbsp; */br /nbsp; // Badly-formatted code that will need to be cleaned /nbsp; if($badly-formatted_code) { $arg++; }/code/div/p pThat last bit illustrates an important point: commit code before cleaning up. I've lost count of the number of times that I've got it working, and cleaned up, and then broken it because I've accidentally removed an important that was lost among the cruft. So as soon as code is working, I make a commit, usually whose message is something like 'TOUCH NOTHING IT WORKS!'. Then, start cleaning up: remove the commented-out bits, the false starts, the stray code that doesn't do anything. (This is where you find it actually does, and breaks everything: but that doesn't matter, because you can just revert to a previous commit, or even use git bisect.)/p h2Keeping up to date/h2 pCore (or the module you're working on) doesn't stay still. By the time you're ready to make a patch, it's likely that there'll be new commits on the main development branch (with core it's almost certain). And prior to that, there may be commits that affect your work in some way: API changes, bug fixes that you no longer need to work around, and so on./p pOnce you've made sure there's no work currently uncommitted (either use git stash, or just commit it!), do:/p pdiv class=codeblockcodegit fetchbr /git rebase BRANCH/code/div/p pwhere BRANCH is the main development branch that is being committed to on, such as 8.0.x, 7.x-2.x-dev, and so on./p p(This is arguably one case where a local branch is easier to work with than a github-style forked repository.)/p pThere's lots to read about rebasing elsewhere on the web, and some will say that rebasing is a terrible thing. It's not, when used correctly. It can cause merge conflicts, it's true. But here's another place where small, regular commits help you: small commits mean small conflicts, that shouldn't be too hard to resolve./p h2Making a patch/h2 pAt some point, I'll have code I'm happy with (and I'll have made a bunch of commits whose log messages are 'clean-up' and 'formatting'), and I want to make a patch to post to the issue:/p pdiv class=codeblockcodenbsp; git diff 7.x-1.x gt; 123456.PROJECT.foobar-is-broken.patch/code/div/p pAgain, I use the issue number in the name of the patch. Tastes differ on this. I like the issue number to come first. This means it's easy to use autocomplete, and all patches are grouped together in my file manager and the sidebar of my text editor./p h2Reviewing and improving on a patch/h2 pNow support Alice comes along, reviews my patch, and wants to improve it. She should make her own local branch:/p pdiv class=codeblockcodenbsp; git checkout -b 123456-foobar-is-broken/code/div/p pand download and apply my patch:/p pdiv class=codeblockcodenbsp; wget PATCHURLbr /nbsp; patch -p1 lt; 123456.PROJECT.foobar-is-broken.patch/code/div/p p(Though I would hope she has a bash alias for 'patch -p1' like I do. The other thing to say about the above is that while wget is working at downloading the patch, there's usually enough time to double-click the name of the patch in its progress output and copy it to the clipboard so you don't have to type it at all.)/p pAnd finally commit it to her branch. I would suggest she uses a commit message that describes it thus:/p pdiv class=codeblockcodenbsp; git commit -m joachim's patch at comment #1/code/div/p p(Though again, I would hope she uses a GUI for git, as it makes this sort of thing much easier.)/p pAlice can now make further commits in her local branch, and when she's happy with her work, make a patch the same way I did. She can also make an interdiff very easily, by doing a git diff against the commit that represents my patch./p h2Incorporating other people's changes to ongoing work/h2 pAll simple so far. But now suppose I want to fix something else (patches can often bounce around like this, as it's great to have someone else to spot your mistakes and to take turns with). My branch looks like it did at my patch. Alice's patch is against the main branch (for the purposes of this example, 7.x-1.x)./p pWhat I want is a new commit on the tip of my local branch that says 'Alice's changes from comment #2'. What I need is for git to believe it's on my local branch, but for the project files to look like the 7.x-1.x branch. With git, there's nearly always a way:/p pdiv class=codeblockcodenbsp; git checkout 7.x-1.x ./code/div/p pNote the dot at the end. This is the filename parameter to the checkout command, which tells git that rather than switch branches, you want to checkout just the given file(s) while staying on your current branch. And that the filename is a dot means we're doing that for the entire project. The branch remains unchanged, but all the files from 7.x-1.x are checked out./p pI can now apply Alice's patch:/p pdiv class=codeblockcodenbsp; wget PATCHURLbr /nbsp; patch -p1 lt; 123456.2.PROJECT.foobar-is-broken.patch/code/div/p p(Alice has put the comment ID after the issue ID in the patch filename.)/p pWhen I make a commit, the new commit goes on the tip of my local branch. The commit diff won't look like Alice's patch: it'll look like the difference between my patch and Alice's patch: effectively, an interdiff./p pdiv class=codeblockcodenbsp; git commit -m Alice's patch at comment #2/code/div/p pI can now do a diff as before, post a patch, and work on the issue advances to another iteration./p pHere's an example of my local branch for an issue on Migrate I've been working on recently. You can see where I made a bunch of commits to clean up the documentation to get ready to make a patch. Following that is a commit for the patch the module maintainer posted in response to mine. And following that are a few further tweaks that I made on top of the maintainer's patch, which I then of course posted as another patch./p pimg src= width=457 height=257 alt=A screenshot of a git GUI showing the tip of a local branch, with a commit for a patch from another user. //p h2Improving on our tools/h2 pWhere next? I'm pretty happy with this workflow as it stands, though I think there's plenty of scope for making it easier with some git or bash aliases. In particular, applying Alice's patch is a little tricky. (Though the stumbling block there is that you need to know the name of the main development branch. Maybe pass the script the comment URL, and let it ask what the branch of that issue is?)/p pBeyond that, I wonder if any changes can be made to the way git works on A sandbox per issue would replace the passing around of patch files: you'd still have your local branch, and merge in and push instead of posting a patch. But would we have one single branch for the issue's development, which then runs the risk of commit clashes, or start a new branch each time someone wants to share something, which adds complexity to merging? And finally, sandboxes with public branches mean that rebasing against the main project's development can't be done (or at least, not without everyone know how to handle the consequences). The alternative would be merging in, which isn't perfect either./p pThe key thing, for me, is to preserve (and improve) the way that so often on, issues are not worked on by just one person. They're a ball that we take turns pushing forward (snowball, Sisyphean rock, take your pick depending on the issue!). That's our real strength as a community, and whatever changes we make to our toolset have to be made with the goal of supporting that./p /div/div/divul class=links inlineli class=comment-add first lasta href=/comment/reply/33#comment-form title=Share your thoughts and opinions related to this posting.Add new comment/a/li /ul

PreviousNext: Lightning talk - Drupal 8's Third Party Settings Interface

Thu, 11/27/2014 - 03:22
pDuring this weeks developers' meeting our lightning talk was all about Drupal 8's ThirdPartySettingsInterface./p pHere's the video introduction to this powerful new feature in Drupal./p span property=dc:title content=Lightning talk - Drupal 8#039;s Third Party Settings Interface class=rdf-meta element-hidden/span

Acquia: Part 2 – Cal Evans and Jeffrey A. jam McGuire talk open source

Thu, 11/27/2014 - 00:53
div class=form-item form-type-item labelLanguage /label Undefined /div div class=field field-name-body field-type-text-with-summary field-label-hidden div class=field-items div property=content:encoded class=field-item evenpstrongVoices of the ElePHPant / Acquia Podcast Ultimate Cage Match Part 2/strong - I had the chance to try to pull Cal Evans out of his shell at DrupalCon Amsterdam. After a few hours, he managed to open up and we talked about a range of topics we have in common. In this part of our conversation we talk about 'Getting off the Island', inter-project cooperation in PHP and Drupal's role in that; the reinvention and professionalization of PHP core development; decoupled, headless Drupal 8; PHP and the LAMP stack as tools of empowerment and the technologists' responsibility to make devices and applications that are safe, secure, and private by default./p /div /div /div span property=dc:title content=Part 2 – Cal Evans and Jeffrey A. quot;jamquot; McGuire talk open source class=rdf-meta element-hidden/span

David Norman: Drupal Workstation Configuration

Wed, 11/26/2014 - 22:24
div class=field field-name-body field-type-text-with-summary field-label-hidden pI use a MacBook Pro with Retina for work - they make the best hardware and operating system combination. I also use a a href= 5/a, iPad 3, a href=;camp=1789amp;creative=390957amp;creativeASIN=B00AWH595Mamp;linkCode=as2amp;tag=classicdev-20Kindle Paperwhite 2/a, and a href=;camp=1789amp;creative=390957amp;creativeASIN=B00FNPD1VWamp;linkCode=as2amp;tag=classicdev-20Chromebook/a. I had an iPhone for about 9 months - I didn't like it. If I shed one of my devices, it'd be the iPad./p pI a href= my blog/a to use HTTPS. I assume government agencies broke SSL and have the root signing keys for certificate providers. I'm just hoping HTTPS makes sniffing a blog annoying enough to make a point to someone that sniffs traffic for a living./p pscript async src=// !-- Nits mid-content -- ins class=adsbygoogle style=display:block data-ad-client=ca-pub-1105343943158891 data-ad-slot=4027080527 data-ad-format=auto/ins/p script (adsbygoogle = window.adsbygoogle || []).push({}); /script h2Physical security/h2 pImmediately after turning on a fresh MacBook, I stronga href= Filevault/a/strong. At first, activating Filevault for my work was a policy to follow - now I want it. I went through the mental exercise of having all my personal items lost or stolen. I couldn't imagine an end to what lawyers would do to me if I lost control of their company's confidential information. The rule even applies when living a minimalist lifestyle. At least one minimalist tells how he got robbed a href= sleeping in his own home/a. Filevault 2 on Mac OS 10.8 creates complete encryption transparency. It's hard to tell if a drive is encrypted with Filevault or not without looking at the System Preferences./p pI use screensaver hot corners to activate the screensaver and password protection when I walk away from my MacBook./p pimg src= alt=hot corners //p pWhen someone walks up to my workstation to talk to me or I need a restroom break, all I do is swipe the mouse cursor down to the bottom left corner and my MacBook screen is locked./p pFor addtional security, I also use a screen protector. Though I telecommute, I work frequently at places other than my home like the library, a href= business lounges, and county parks./p pThe a href=;camp=1789amp;creative=390957amp;creativeASIN=B0090ZXV4Samp;linkCode=as2amp;tag=classicdev-203M privacy screen protector/a is the only one I take seriously. It doesn't keep my screen from getting dirty, though it will block unexpected sneeze splittle - rather it keeps wandering eyes next to me from reading what is on my screen. I prefer the black filter over the gold one, though I agree with reviewers that say the gold filter is more effective./p h2Password management/h2 pHackers compromised my a href= account in 2011. Unfortunately, my password for MtGox was the same as what I used on every other website I use. After the release of the password file, anyone could have assumed my digital identity online. The silly part was, I already used a wonderful password manager - a href= pToday, I keep passwords in both 1Password and a href= - I don't re-use passwords anymore. Generating a random password for every site makes me so dependent on having a password manager that having redundancy doesn't bother me. Adding Lastpass to my toolbox gave me options for new toys, like using a Chromebook, since Lastpass is platform-agnostic./p h2Version control/h2 pWhen I started doing public development of a href=, someone suggested using a href= to manage contributions from other people and I thought they were nuts. All CVS was going to do was add a bunch of aggravating complexity. I still don't think Thatware ever reaped anything worthwhile by using CVS before I abandoned it. By the time I introduced CVS to the project, my interest in Thatware was already waning./p pMy progress on Thatware stalled after an email I got from a href= Buytaert/a asking why I didn't use a href= joins/a anywhere in Thatware's database queries. I didn't know what a table join was at the time - the little bit of SQL I had implemented was all copied from a post I found on a href= Shed/a. As it turns out, doing a couple table joins instead of queries, nested in loops, is about 10 times faster. Dries proved it when he had me benchmark alternative scripts. Those scripts turned into what people know today as a href= Needless to say, I yielded to his superiority./p pIn time, I shifted my CVS knowledge from Thatware to Drupal. When I discovered I could commit to any contributed module's CVS repository, I spread my generosity where it wasn't wanted, which ended with a href= commits/a to the a href= module. After that time, CVS commits got access hooks to verify maintainers were listed in the project node. I still intend to see the Windows-style newlines removed someday, even if the project stays in an officially abandoned state./p pI used a href= for professional work alongside CVS for community code. I thought Subversion and CVS were equal platforms with different methods for versioning files./p h3Git/h3 pToday, I use a href= When I was using Subversion, I thought it was fine. I only switched to Git because the Drupal project did. Now I've experienced the ease of branching in Git versus Subversion. Doing local merges makes resolving conflicts easier. I'll never go back to Subversion by choice./p pa href= a href= pThe normal codegit log/code output is useless to me, so I never run it. I do get some value by running an alternate version of the log command that outputs the merge tree./p precodegit config --global alias.lg log --color --graph \ --pretty=format:'%Cred%h%Creset \ -%C(yellow)%d%Creset %s \ %Cgreen(%cr)%C(bold blue)lt;%angt;%Creset' --abbrev-commit /code/pre pLook at the difference between codegit log/code:/p pimg src= alt=git log //p pand codegit lg/code:/p pimg src= alt=git lg //p pGit versions before 2.0 would push all of the local braches that matched a remote branch name using a emmatching/em method. As of Git 2.0, it switches to a more conservative emsimple/em behavior, pushing only the current branch to the corresponding remote branch it is configured to follow. The new, 2.0 emsimple/em version is set through/p precodegit config --global push.default simple /code/pre pTo retain the older method of pushing all emmatching/em branches, even after upgrading to Git 2.0:/p precodegit config --global push.default matching /code/pre h2Terminal/h2 pMy colleagues recommended a href=http://www.iterm2.comiTerm/a as a replacement for the built-in, Apple-provided terminal. It offers options for a split pane, autocomplete, and paste history which aren't available with the Apple terminal./p piTerm also protects me against myself by blocking a system shutdown when I have a terminal open. Before iTerm blocked shutdown in Mac, I would shutdown my Mac with an open SSH or a href= connection. Since I never use a href=, shutting down sometimes broke something in-process, like codeapt-get upgrade/code./p pThe default theme of either terminal is not suitable for me - or at least I think it could be improved. Instead, I use the a href= Night/a theme. I combine Adobe's a href= Code Pro/a font with a a href= to make my default terminal./p pimg src= alt=Druplicon terminal motd //p pThe Druplicon ASCII art shows at the start of each new terminal window I open, whether I use Apple's Terminal or iTerm, by using the system a href= The Internet is full of web-based tools that can convert an image file to ASCII art, but I created the Druplicon by hand so I could customize the output to fit in 80 columns and 25 lines for the default terminal window size./p pMac OS X doesn't come with a code/etc/motd/code file by default, but if you create one, it will get used. To get access to write to code/etc/code, you'll need to sudo as a user with administrative rights./p precodesudo su - cat ~/Downloads/ascii_druplicon.txt gt; /etc/motd exit /code/pre h3OH MY ZSHELL!/h3 pBash was all I needed as a commandline interpreter until I started using git. I when I was informed about a href= and that it support various plugins, it was a huge annoyance to do any commands inside any git repository without the assistance of zsh./p pRobby Russel hosts the official installer. It only needs one command in a terminal./p precodecurl -L | sh /code/pre pAfter installation, examine the code.zshrc/code file in your home directory. Two options to pay particular attention to are codeZSH_THEME/code for theme and codeplugins/code for plugins./p pThroughout this book, screenshots I take of a terminal window use the codegallifrey/code zsh theme./p pI could live with just the codegit/code plugin - I have a tendency to enable zsh plugins that I have no idea how to use. Now when cloning git repositories, the codegit/code plugin for zsh shows the checked-out branch of your current directory as well as any subdirectories./p pimg src= alt=iTerm oh my zsh //p pIn the case of setting variables for a plugin like jira, I could either create a code~/.jira-url/code file or add the codeJIRA_URL/code setting to code~/.zshrc/code. There's a trade-off between being able to/p precodecat gt; ~/.jira-url /code/pre por centralizing the configuration. I opted for putting it in the code~/.zshrc/code file directly because I think I'm more likely to remember that the codejira/code command is a zsh plugin and look for the configuration in zsh's file./p h2Show hidden files/h2 pThe operating system doesn't matter - I like to see all the hidden files on my filesystems. In Mac OS, I show them all by a href= an article on Lifehacker/a to get the correct terminal commands./p precodedefaults write \ AppleShowAllFiles TRUE killall Finder /code/pre pCommands like this can also be aliased in your code~/.zshrc/code file./p precode# Show/hide hidden files in Finder alias show=defaults write \ AppleShowAllFiles -bool true amp;amp; killall Finder alias hide=defaults write \ AppleShowAllFiles -bool false amp;amp; killall Finder /code/pre pSince I use a href= to minimize the number of .DS_Store files on my Mac and network drives, I periodically see files show in finder, then disappear. On my desktop, the Mac system files sometimes stack on top of files I want, making it annoying to work with files from my desktop./p pimg src= alt=BlueHarvest //p pThe default settings for BlueHarvest 5 only remove Apple files on remote drives, so I add my home directory as an additional location./p h3Alfred/h3 pa href=http://www.alfredapp.com h3Bartender/h3 pimg src= alt=Bartender //p pa href=http://www.macbartender.com h3ClamXav/h3 pI suspect antivirus is an under-utilized tool on Mac OS X installations, but I don't let that stop me from running it. a href=http://www.clamxav.comClamXav/a is a free antivirus utility which can monitor directories in additon to a standard, manual scan./p pimg src= alt=ClamXav //p pClamXav can be setup up as passive or active: scan only the files you tell it to or your entire computer. I activated Sentry to monitor my home folder and scan new files as they arrive. I usually download files from the Internet to either code~/Downloads/code or code~/tmp/code. Doing my entire home directory also covers unknowingly downloading a virus through Apple Mail or as browser cache from Google Chrome./p h3Crashplan/h3 pa href= is the only backup solution I've found where I can backup my files encrypted to an offiste datacenter and to another computer in my house. The other computer in my house is key - when I used other services like a href= Disk/a, the restore process was painful. Downloading files archived on the Internet as multiple hundreds of gigabytes is painful. At least when I need to a restore from another computer in my house, I can control the network conditions. Getting files restored from the Internet is only my plan for catastrophic events - burgulary, fire, tornado./p h3Dropbox/h3 pI store my Calibre library; 1Password keychain; Alfred, Codekit and TextExpander configurations; Leanpub documents; and a few small file backups encrypted by a href= a href=https://www.dropbox.com h3Browsers and plugins/h3 pI used Netscape Navigator back in the 1990s. Since then, I've felt some membership on team Firefox. Truthfully, since I switched to using Android for my phone, I've stuck with a href= Chrome/a. I feel like Chrome simplifies my life somehow. The market dominance Chrome gained in 2013 doesn't give me much reason to move back to Firefox, either./p h4Chrome extensions/h4 ul lia href= for password management/li lia href= to block advertisements/li lia href= to queue up messages on social networking to target readers at times they're most likely to be reading social networks/li lia href= adds functionality for patch reviews and Git commit messages to the issue queue/li lia href= Dropper/a to show me hex colors of pages on the Internet/li lia href= Analytics Opt-out Add-on/a in hopes of reducing how much I get tracked on the Internet/li lia href= Docs/a was added by my Chromebook/li lia href= Everywhere/a because the Internet should be encrypted/li lia href= Close/a closes incognito tabs if they're inactive for 30 minutes/li lia href= intergrates with my Lastpass vault/li lia href=!/a measures pixels/li lia href= is another way I can use a terminal to a remote server while I'm using my Chromebook/li lia href= is a shortcut for sending articles for me to read later on a href= lia href= for Chrome/a tells a href=https://www.rescuetime.comRescueTime/a what pages I'm visiting instead of just recording that I'm using Chrome, otherwise, it can't help gauge my web-based productivity/li lia href= Shell/a so I can SSH into remote servers from my Chromebook/li lia href= to Kindle for Google Chrome/a can send websites as e-books to my Kindle Paperwhite/li lia href= opens GitHub files in Sublime Text when paired with the Subhub package in Sublime Text/li lia href= is an offline code editor with Dropbox and Google Drive integration/li lia href= is a text editor/li lia href= Fu/a implemented my a href= keyboard layout/a experiment for learning how to type/li lia href= is an offline text editor with Dropbox and Google Drive integration/li lia href= for Chrome/a makes a shortcut to my a href= task archive/li /ul h3ImageOptim/h3 pIt occurred to me one day that if Drupal had hundreds of thousands of downloads, then those Drupal installations each had millions of page views, that compressing images in the Drupal core distribution could have a ripple effect for saving thousands of gigabytes of unnecessary network trafficsup id=fnref:552000a href=#fn:552000 rel=footnote1/a/supsup id=fnref:562968a href=#fn:562968 rel=footnote2/a/supsup id=fnref:704182a href=#fn:704182 rel=footnote3/a/supsup id=fnref:824326a href=#fn:824326 rel=footnote4/a/supsup id=fnref:848312a href=#fn:848312 rel=footnote5/a/supsup id=fnref:874370a href=#fn:874370 rel=footnote6/a/supsup id=fnref:922034a href=#fn:922034 rel=footnote7/a/supsup id=fnref:922048a href=#fn:922048 rel=footnote8/a/supsup id=fnref:935122a href=#fn:935122 rel=footnote9/a/sup./p pThe image output from programs like a href=, a href=, a href=, and even the built-in a href= hotkeys/a for Mac OS X, have a bunch of unnecessary comments and color profiles that have no relevance to the Internet environment. Editing a JPG in GIMP, then exporting it with 80% compression still has the opportunity to remove extra file bytes without any quality loss./p pa href=http://imageoptim.comImageOptim/a wraps a href=, a href=, a href=, a href=, a href=, a href=, jpegrescan, jpegtran, and a href= I keep ImageOptim in my Mac Dock, then drag image files to the ImageOptim icon in my Dock to optimize them. I find the outputs save 5-25% on the output file size./p pimg src= alt=ImageOptim //p pRather than getting the default output from CMD+SHIFT+4, I prefer to focus a specific type of interaction, output location, and filename. This codescreencapture/code command outputs the screenshot of whatever window I click on, in JPG format on my desktop. After I process the output with ImageOptim, the screenshot complies with all the size and format rules I need for adding to this book./p precodescreencapture -tjpg -oW ~/Desktop/imageoptim.jpg /code/pre pa href= uses the same principles as ImageOptim, except that it works specifically on PNG files and applies lossy compression and converts the PNG to PNG8+alpha format - that's a fancy way of saying it proposes to convert the image from full color to 256 colors. The 256 color palate change by itself can reduce image sizes by around 70% and you can probably only tell the difference on full-color photos. a href= the backend utility for ImageAlpha./p h3Kindle Previewer/h3 pa href= h3Skitch/h3 pa href= h3SmartSynchronize/h3 pa href= h3Viscosity/h3 pa href= h3f.lux/h3 pThe evening is a tricky time to balance activities. While I know I shouldn't spend much of any evening on the computer, sometimes I do, even if I'm just working on our family budget. When it's dark in the house, it's easy for a phone or computer screen to blind me, even after the computer does a brightness compensation for the dark./p pa href= makes my computer screen tint match the lighting in the room at night. It goes beyond just a brightness change, because the blue tint of the computer screen without a red filter at night doesn't match what the average light bulb emits. If I worked in an office cave, I could set the daylight hours to match the florescent lighting in the room./p pimg src= alt=f.lux //p pThe preferences automatically identify my location. With the transition time set to 1 hour, I don't even notice the screen tint change. I think f.lux is an an application that every computer user should install, regardless of your technical skills and abilities. I'd have my father-in-law install it./p h3E-book management/h3 pI'm not a fan of how set the Kindle book royalty structure for authors, but I am fond of their a href=;camp=1789amp;creative=390957amp;creativeASIN=B00AWH595Mamp;linkCode=as2amp;tag=classicdev-20Paperwhite/a for the non-glare screen and their centralized document management. Their implementation for sending an email with an e-book attachment to my Kindle is a great system./p pAfter I buy an e-book, I think I should own it. Kindle DRM doesn't follow that spirit since Amazon makes it hard to move a book from my Kindle to iBooks. [a href=]]/a(Apprentice Alf) has DRM removal tools for e-books. My DRM-free e-books are managed by a href= pimg src= alt=dedrm //p pCalibre is free. The DRM removal plugin for Calibre makes it possible to import books from my Kindle to my Dropbox. I convert my books to other formats, store whitepapers, documentation, and presentations in Calibre so I can find them easily when I decide to email them to friends./p pimg src= alt=Calibre //p h3Meeting online/h3 pa href= audio hijack pro a href= Skype IRC Squiggle Dropcam GoToMeeting FreeConferenceCall a href= Cloud Meetings/a/p pimg src= //p pimg src= grid //p h3More/h3 pa href= sorts out all my windows when I'm doing research between iTerm, Google Chrome, and Sublime Text. By clicking the Divvy icon in the menu bar, I can drag across a grid to organize my open applications to not clobber each other on the screen. It divides my screen into exact portions so I don't have to mess with dragging windows to specific sizes./p pDivvy also has a method for organizing applications by shortcut. One global keyboard shortcut setting opens the Divvy grid. Then, a second combination, specific to your Divvy preferences, sets the window sizes according to your own preset grid./p pimg src= alt=Divvy //p h4 id=hazelHazel/h4 pa href= advertises itself as a personal housekeeper. It's a rule engine that keeps files organized by whatever means you tell it. The default rules use color labels for downloads so I can quickly find new downloads and see reminders when it's time to archive installers to my a href=#droboDrobo/a./p pimg src= alt=Hazel tmp //p pa href= Menus/a requires an admin account to install a resource monitor. I configure it to show my CPU load, memory use, disk space consumption, and temperatures for my CPU and GPU./p pimg src= alt=iStat Menus //p h3Internet tethering/h3 pa href= is a Mac OS X driver for using my Android phone's native USB tethering mode. The driver is free and the source is available a href= GitHub/a./p pimg src= alt=HoRNDIS //p pAfter installing the driver, I didn't have to configure anything. I just plugged my Nexus 5 into my Mac, then activated USB tethering on my phone in the Settings app./p pimg src= alt=usb tethering //p pSince I tether frequently, I added a widget to my phone to the emTethering amp; portable hotspot/em settings. By adding a widget to emSettings shortcut/em, then placing the widget icon, the widget will ask for the setting you'd like to set the widget to load./p pimg src= alt=tethering widget //p pThe emPortable Wi-Fi hotspot/em option on my Android also works, but I've found that using it in a building with a bunch of other wireless networks seems congested. There seems to be a limit to how much wireless traffic can broacast through the air before it all jumbles together. Since I keep my phone plugged in anyway while tethering to keep the battery from draining too fast, the USB tethering becomes an overall more attracive option./p pa href= File Transfer/a is not available while using the USB tethering./p h3Drobo/h3 pMy a href= is one of two things I've ever locked to my desk with a a href= lock/a. Thanks to having SSH and rsync on my Drobo, I can rsync backup snapshots over my home network. For that, I created a bash script that I keep in code~/bin/code, which is in my code~/.zshrc/code codePATH/code./p precode#!/bin/sh rsync -a --delete --progress --ignore-errors \ --rsh=ssh /Users/davidnorman \ root@ rsync -a --delete --progress --ignore-errors \ --rsh=ssh /Applications \ root@ rsync -a --delete --progress --ignore-errors \ --rsh=ssh /private \ root@ /code/pre h2Other apps to consider/h2 pbee, brackets, byword, caffeine, pckeyboardhack, quiet, readkit, rescuetime, capsee, carboncopycloner, requiem, resolutiontab, codekit, codebox, coffitivity, sequel pro, shortcat, smartsyncrhronize, sourcetree, spideroak, expandrive, tower, gpgtools, gabble, github, google drive, unplugged, kaleidoscope, ia writer, icon slate, keyremap4macbook, libreoffice, owncloud, ripit vs handbrake, brew install youtube-dl/p div class=footnotes hr / ol li id=fn:552000 pa href= core images/a#160;a href=#fnref:552000 rev=footnote#8617;/a/p /li li id=fn:562968 pa href= module and theme images/a#160;a href=#fnref:562968 rev=footnote#8617;/a/p /li li id=fn:704182 pa href= transparent PNG instead of opacity for overlay background to gain rendering performance/a#160;a href=#fnref:704182 rev=footnote#8617;/a/p /li li id=fn:824326 pa href= Drawer link doesn't show focus/a#160;a href=#fnref:824326 rev=footnote#8617;/a/p /li li id=fn:848312 pa href= a new Druplicon logo for Bartik/a#160;a href=#fnref:848312 rev=footnote#8617;/a/p /li li id=fn:874370 pa href= messages need identifying icons (WCAG 2.0)/a#160;a href=#fnref:874370 rev=footnote#8617;/a/p /li li id=fn:922034 pa href= Bartik images/a#160;a href=#fnref:922034 rev=footnote#8617;/a/p /li li id=fn:922048 pa href= seven ui icons/a#160;a href=#fnref:922048 rev=footnote#8617;/a/p /li li id=fn:935122 pa href= Images using Lossless Techniques/a#160;a href=#fnref:935122 rev=footnote#8617;/a/p /li /ol /div /div !-- field.tpl -- div class=field field-name-taxonomyextra field-type-taxonomy-term-reference field-label-above labelPost categories/label div class=field-itemi class=fa fa-tag/i a href=/taxonomy/term/27Drupal/a/div /div

David Norman: Sublime Text for Drupal

Wed, 11/26/2014 - 22:02
div class=field field-name-body field-type-text-with-summary field-label-hidden pThe novel, a href=;camp=1789amp;creative=390957amp;creativeASIN=B000SEGEKIamp;linkCode=as2amp;tag=deekayen-20The Pragmatic Programmer: From Journeyman to Master/a, the advocate for using a single file editor for as many tasks as you can./p blockquote pWe think it is better to know one editor very well, and use it for all editing tasks: code, documentation, memos, system administration, and so on. Without a single editor, you face a potential modern day Babel of confusion. You may have to use the built-in editor in each language's IDE for coding, and an all-in-one office product for documentation, and maybe a different built-in editor for sending e-mail. Even the keystrokes you use to edit command lines in the shell may be different. It is difficult to be proficient in any of these environments if you have a different set of editing.../p /blockquote pAt this point of writing this book, I've already used a href=, a href=, a href= Text/a, a href=, a href=, a href=, a a href=;camp=1789amp;creative=390957amp;creativeASIN=B008MZZ6AOamp;linkCode=as2amp;tag=classicdev-20pad of paper/a, and two dry erase boards./p pMy trial of other editors in this project as part of routine experimentation. Staying informed about the latest tools is necessary to prevent becoming a technological dinosaur. In 2013, I settled deep into using Sublime Text for as many things as I could. Viewing and editing files in Sublime wasn't part of a conscious effort, rather I think it was just a natural result of what Andrew Hunt and David Thomas identified in their Pragmatic Programmer book./p pscript async src=// !-- Nits mid-content -- ins class=adsbygoogle style=display:block data-ad-client=ca-pub-1105343943158891 data-ad-slot=4027080527 data-ad-format=auto/ins/p script (adsbygoogle = window.adsbygoogle || []).push({}); /script pAs a developer, themer, designer, or manager of any of those, I've found my editor to be a critical tool and one in which I spend a lot of time. In 2013, Sublime Text was my third-most used application./p pimg src= alt=Rescuetime chart of 50% of programs for David Norman //p pWhat the a href= chart doesn't show clearly is that I actually spent most of my time processing email because I used Gmail as my email client at work for an extended trial period. I tell people I work with that email should be considered a low-priority medium of communication - one in which I emmight/em respond in a week when I attempt to re-gain my a href= zero/a status. This chart has a long tail of other websites and applications spreading out to 3965 items, including me browsing and watching YouTube./p pSublime Text is the second place where zsh plugins shine. GitHub is littered with various a href= and alias files to create a terminal alias to run Sublime Text from a terminal. When you add the codesublime/code plugin to your code~/.zshrc/code file, it handles aliasing the codesubl/code binary packaged in the regular codeSublime bundle./p pimg src= alt=subl .zshrc //p pWhether on Linux or Mac, the zsh plugin searches the code/usr/local/bin/code and code/Applications/code paths to locate and make the codesubl/code binary file available as both codesubl/code and codest/code. Having some basic codevi/code or codenano/code knowledge for server management and devops is nice, but when you have a perfectly good GUI available, I say use it. Additionally, zsh also makes a codestt/code command available to the terminal for opening the current directory in Sublime Text./p pimg src= alt=sst command results //p h2Basic syntax/h2 pSublime Text uses the codePreferences / Settings - User/code menu to create a file named codePreferences.sublime-settings/code for storing various formatting options. To match most of the Drupal coding standards, start with the following JSON settings:/p precode{ default_line_ending: unix, ensure_newline_at_eof_on_save: true, fallback_encoding: UTF-8, rulers: [ 80 ], shift_tab_unindent: true, spell_check: true, tab_size: 2, translate_tabs_to_spaces: true, trim_automatic_white_space: true, trim_trailing_white_space_on_save: true, use_tab_stops: true, word_separators: ./\\()\'-:,.;lt;gt;~!@#%^amp;*|+=[]{}`~? } /code/pre pSublime Text can have multiple rulers. Setup one for drafting email, one for code, another for markdown documents./p precoderulers: [72, 80, 120], /code/pre pPasting code from another file or from a sample I find on the Internet is annoying, because I have to spend the next 30 seconds fixing the indentation. And even if the indentation levels happen to match, chances are I didn't select the leading whitespace, so I still have a formatting hassle to sort out. The Paste and Indent command automatically adjusts the indentation of the code from the clipboard to match the surrounding code. Add the following to codeDefault (OSX).sublime-keymap/code file through the codeSublime Text - Preferences - Key bindings - User/code menu:/p precode{ keys: [super+v], command: paste_and_indent }, { keys: [super+shift+v], command: paste } /code/pre h2Sublime Text package manager/h2 pThe a href= Text package manager/a is not part of the default installation. There are only two steps in the a href=, which creates a new Sublime Text Preferences menu named Package Control./p pPackage control options are nested into the Sublime Text Command Palette. The shortcut to open the command palette menu on Mac is codecmd+shift+p/code or codectrl+shift+p/code for Windows and Linux from within a Sublime Text window. All the package management options begin with codePackage Control:/code - the list is narrowed by typing codepackage/code, or even just codeinstall/code in the command palette prompt./p pimg src= alt=Sublime Text install package //p h2Drupal/h2 pOnce you've navigated to the codePackage Control: Install Package/code menu, typing codeDrupal/code in the next Command Palette prompt should show the a href= package by robballou/a./p pimg src= alt=Sublime Text install Drupal package //p pThe Drupal package has various completions for Drupal 7, which it can do within the context of filename extensions. For example, in projects with a file, the Drupal package will adds a syntax file type named codeDrupal Info File/code and autocomplete triggers based on codename/code, codedescription/code, codedependencies/code, codepackage/code, codecore/code, codephp/code, codeversion/code, codefiles/code, codescreenshot/code, codeengine/code, coderegions/code, codefeatures/code, codescripts/code, codesettings/code, and codestylesheets/code./p pThe Drupal package goes on to have autocomplete abilities for a comprehensive list of all Drupal's core functions, hooks, form API, theming, and several contributed modules - devel, migrate, and views./p pThe autocomplete functionality is complete enough to interpret your current code$query/code variable in PDO syntax and expand upon condition statements to provide the syntax for the field, value and operator in the condition statement. Each of the Drupal completions are also context sensitive, meaning that if you wanted to access the codefapi/code autocomplete shortcut for a markup item, the autocomplete menu won't appear unless you are in the context of a PHP function, within a valid codelt;?php/code block of a PHP file./p pimg src= alt=Sublime Text FAPI autocomplete //p pSublime Text autocomplete snippets for any language, Drupal, PHP, or Python, work on a principle of tabs. As long as you have an idea of what snippet trigger you need, the codetab/code key will trigger the autocomplete event. The Drupal package could also serve as an alternative to copy and pasting code from the a href= for Developers/a project since shortcuts like codeblock/code will fill-out an entire list of stub functions in which you can fill in arguments to name all the functions with the same prefix in one effort by tabbing between elements in the stub./p h2Behat/h2 pThe a href= and a href= Features/a packages are close in functionality. The maintainer of Behat Features originally forked his code from the Behat project in apparent frustration of getting changes added back to the Behat project on Github./p pimg src= alt=Sublime Text behat features //p pBoth Behat packages have equivalent syntax highlighting for code.feature/code files, except that the Behat Features package adds support for French, German, Italian, Portuguese, Spanish, and Russian. Though I only read English, I installed Behat Features./p h2Tomorrow theme/h2 pContinuity between my terminal and Sublime Text is nice, so I theme my editor with the a href= color scheme/a. The Tomorrow theme can be activated through the codeSublime Text / Preferences / Color Scheme / Tomorrow Color Schemes/code menu on Mac OS X./p h2Sass and SCSS/h2 pAs I browse through the Sublime Text packages, it's easy to two packages like a href= and a href=, then assume I need them both - the a href= syntax was superceeded by SCSS/a. Upon closer inspection, both packages for Sublime Text highlight Sass and SCSS./p pThough the SCSS package pitches itself as the official bundle, I only installed the Sass project. I was troubled by the management of the SCSS project because it managed the Sublime Text package within a branch of the larger SCSS TextMate repository - the same repository which also has a Chocolat truffle in a different branch. Using git branches in that manner is wrong - each of the support bundles should be their own repository for each editor./p pThe Sass package for Sublime Text is properly managed all as a single bundle in a fork from the SCSS project. The Sass fork took time to pull contributions from other forks. I consider the result to be more curated. Since Sass is a fork of SCSS, it contains all of what was official up until the fork anyway. Installing both packages would be redundant./p h2DocBlockr/h2 pThe a href= package completes docblock comments in code. In PHP, just typing code/**/code then return, will examine the context in which you're typing, then fill in the rest./p pimg src= alt=Sublime Text DocBlockr comments //p pDocBlockr's formatting is not Drupal a href= standards/a compliant, so some adjustments are necessary. Navigate the Sublime Text menus on Mac OS X to codeSublime Text / Preferences / Package Settings / DocBlockr / Settings - User/code./p pThe following modifications to the default rules bring the DocBlockr output into a reasonable proximity to compliance with Drupal's standards./p precode{ // Align words following the @tags. // Values: no, shallow, deep. jsdocs_align_tags: no, // Add blank lines between the description // line and tags of different types. jsdocs_spacer_between_sections: true, // Shorten primitives such as boolean // and integer to bool and int. jsdocs_short_primitives: true, // Add a '[description]' placeholder // for the @return tag. jsdocs_return_description: false, // Add a '[description]' placeholder // for the @param tag. jsdocs_param_description: false, } /code/pre pThough Drupal's comment standards to prefer descriptions added to code@param/code and code@return/code, DocBlockr doesn't have a setting to shift the description to the line below each block tag. Instead, the above configuration omits the description placeholder - you'll have to add it on your own. Also note, the configuration file for DocBlockr user preferences is codeBase File.sublime-settings/code - it doesn't have DocBlockr in the name as I expected./p pDocBlockr does not conflict with the Drupal package. When typing codehook/code then pressing codetab/code in a PHP file, you'll still get the same magic function stub, complete with docblock./p precode/** * Implements hook_function(). */ function example_function(args) { } /code/pre h2SublimeGit/h2 pThe a href= and a href= packages offer similar functionality - another scenario where installing both is redundant./p pI use SublimeGit for codegit diff/code when I want to make a quick patch for a Drupal module. Though I checkout modules from in iTerm, the process to update the contributed module versions in the Guardr project make file could look something like this./p ol liLoad a href= It's usually in my browser history./li liClick the Version control tab/li liCopy the codegit clone/code line to the clipboard/li licodecmd+space/code, iTtab (to autocomplete iTerm)/li licodecd/code to code~/Sites/code/li lipaste the clone line for Guardr, then codecd/code into the clone/li licodesubl dlt;tabgt;.lt;tabgt;/code/li liMake required version updates in the Sublime Text window/li licodecmd+s/code to save/li licodecmd+shift+p/code, codegit dif/code, and save the result as a code.patch/code file for uploading to an issue on /ol h2SublimeLinter/h2 pa href= with a href= can do syntax checking, a basic function found in most any code-centric IDE. SublimeLinter has PHP-related syntax check plugins, including ones for PHP_CodeSniffer and PHP Mess Detector. I haven't seen a SublimeLinter plugin for PHP PSR compliance, but the [detailed notes] on writing a SublimeLinter plugin explain how someone might go about creating such support./p pimg src= alt=SublimeLint PHP error //p pSince SublimeLinter isn't specific to just PHP, it can also handle lint checks for Puppet manifest files, CSS, Perl, Ruby, Javascript, and a href= bunch of others/a. I picked SublimeLinter over Phpcs package. If later I decide to use the SensioLabs standards fixer, Phpcs can just run that portion of the package and leave the rest to SublimeLinter./p h2Other notable Sublime Text packages/h2 pa href= sorts the methods alphabetically within a PHP class. The sorting preserves Docblocks and any sloppiness that floats between functions within the class gets collected at the top of the class. I've never actually used this plugin for what it's supposed to do because I sort my PHP functions in order of importance. Drupal hook implementations go at the top of the files, followed by functions I'm most likely to rank as important or might need frequent editing, then utility functions at the end. Merely having this plugin ready appeals to my inner-OCD./p pa href= adds two options to the Sublime Text command palette - one highlights lines you have edited, according to Git, the other clears the highlights./p pa href= can expand the file search to look at all the open files, the files in the projects, or of a selected directory. Normally, the find function works only within the current open file. The results show in a new file, along with the filename and line number./p pa href= uses the Sublime Text gutter to add indicators to the left of line numbers that show whether a line has been inserted, modified, or deleted./p pimg src= alt=Sublime Text GitGutter //p pa href= also uses the gutter space to show where brackets of various types start and end: code()/code, code{},/code[]code,/codelt;code./codecode,/code''code,/codetag/tag`. A caveat I've noticed is that a conflict between two gutter plugins usually results in one winner - this one loses to GitGutter, so this would fail to show the start or end of a bracket on a line which had a change since the latest git commit./p pimg src= alt=BracketHighlighter //p pThe spell checker in Sublime Text does a decent job, but it lacks context, industry jargon, and colloquial terms. Adding the a href= Spell Check/a package brings some sanity back to my spelling. The author even made a a href= to show its super powers./p pimg src= alt=Google Spell Check //p pa href= performs the basic functions of encrypt, sign, decrypt, and verify for ASCII armored text. Since a href= and a href= can handle GPG in the email stream, I use GPG for verifying GPG signatures on files or for otherwise handling the miscellaneous exceptions to normal GPG use./p pa href= adds command palette options to get, update, and create issues on a JIRA server. Getting issues prompts for an issue key, then displays the issue in a new tab of Sublime Text./p pa href= has crossover functionality with SublimeLinter in terms of running codephp -l/code on the current file. It can also run a href=, a href= Mess Detector/a, a href=, and the a href= Coding Standards Fixer/a by SensioLabs for PSR compliance. The formatting notifications use a combination of the quick panel, gutter, and status bar to notify about non-compliance./p pDrupal 8 uses a href= for unit tests instead of Drupal 7's Simpletest. This package adds support for right clicking test files from within Sublime Text to run them./p pa href= adds a git menu when right-clicking on files in the sidebar./p pimg src= alt=SideBarGit //p pa href= Config/a highlights syntax code/.ssh/config/code files. It handles essential autocompletion for adding new hosts to the config file, as well./p pa href= uses a combination of a a href= extension/a and a Sublime Text package to insert a Open in Sublime button to pages in Chrome when you browse projects on GitHub./p pimg src= alt=Subhub //p pInstead of loading a separate diff program, a href= shows diffs for git, in tabs side-by-side. It's nice to see differences, but I haven't been able to actually change the edited file while Sublimerge shows the diff. Instead, Sublimerge forces me back to edit mode to make changes. I'm a fan of a href= and its ability to merge and edit in realtime, but it's also annoying to switch to a different application./p pa href= helps you use active, instead of passive voice, and highlights judgmental words like very, clearly, and relatively. Passive voice instances highlight in yellow and judgmental words in grey./p pimg src= alt=SublimeWritingStyle //p pa href= shows the words and/or characters in a document or a selection within a document, as well as an estimated read time. Digits are excluded. I use the following custom WordCount user settings. A few causal minutes of research seems to show that a reasonably educated adult reads at 265 words per minute, depending on whether you're reading for comprehension, pleasure, or scanning on the Internet./p precode{ enable_readtime: true, readtime_wpm: 265, whitelist_syntaxes: [ Markdown, MultiMarkdown, Plain Text ], blacklist_syntaxes: [ CSS, SQL, JavaScript, JSON, PHP ] } /code/pre pa href= highlights all copies of a word which is currently highlighted, or optionally, highlights copies of a word which has the insertion cursor upon it. The a href= file on the Github project page also has a number of configuration options, including treatment of the gutter bar, the status bar, and how to configure the highlight colors./p pa href= Client/a can do breakpoints through clicking lines in the Sublime Text screen and set watch expressions. More on this package later./p /div !-- field.tpl -- div class=field field-name-taxonomyextra field-type-taxonomy-term-reference field-label-above labelPost categories/label div class=field-itemi class=fa fa-tag/i a href=/taxonomy/term/27Drupal/a/div /div

Four Kitchens: Extracting data from Drupal entities the right way

Wed, 11/26/2014 - 19:54
div class=field-body pIf you#8217;ve ever had to extract data from Drupal entities you know it can be a painful process. This post presents a solution for distilling Drupal entities into human-readable documents that can be easily consumed by other modules andnbsp;services./p /div div class=field-blog-categories-term-tree a href=/topics/projects typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Projects/a /div div class=field-blog-categories-term-tree a href=/topics/drupal typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal/a /div

Drupal 8 Rules: #d8rules update October-November 2014

Wed, 11/26/2014 - 18:28
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpCurious why the Rules module still isn't finished, even when our a href=/node/27initial milestone planning/a aimed to ship Rules 8.x by 2014? The bad news is we are a bit delayed, but that pretty much aligns with the state of Drupal 8 core. And we are working hard on solving problems in a generic way for entire Drupal core instead of having to fork APIs in Rules./p h2DrupalCon Amsterdam Recap/h2 pimg alt=#d8rules BoF @ DrupalCon Amsterdam title=#d8rules BoF @ DrupalCon Amsterdam height=160 width=240 class=panopoly-image-quarter media-element file-teaser panopoly-image-quarter src= //p pWe were quite active at DrupalCon Amsterdam: I gave a 12 minutes update on the #d8rules initiative (a href= amp; a href= and we had some productive discussions on crowd funding in general at the community summit (a href= amp; a href= core conversation/a)./p pOn Thursday, we had a BoF to get contributors up to speed with development for Rules in Drupal 8 and on Friday we sprinted the whole day to port actions and get Milestone 1 finished./p h2Development status /h2 pAs a href=[META] Rules 8.x Roadmap/a states, most of the funded Milestone 1 tasks have been finished but a number of core integration tasks are still in progress. The a href= context/a system is going to be used across Blocks, Conditions and Actions API as well as related contrib modules like the Drupal 8 version of a href= Manager/a. In Drupal 7 CTools and Rules together with the Entity module basically invented two separate context systems, so compared to that this is a big step fowards and will bring site builders and developers a much better plugin interopability amp; re-usability in Drupal 8./p pSome core tasks we are currently working on are:/p ul lia href= a trait for categorizing plugin managers and use it for conditions and actions/a/li lia href= Context system for actions/a/li lia href= definition objects to provide options/a/li /ul pIn Rules 8.x-3.x, we recently finisihed the conversion of all condition and action test cases to PHPUnit based integration tests, what helps to test the plugins including their annotation and runs very fast (without a full bootstrap). During the sprints in Amsterdam we worked with contributors on porting more of Rules' actions to the new Action API, including test coverage. We'll continue to work on porting actions with contributors via the issue queue and run sprints on the coming events we attend./p h2Next steps amp; events/h2 pimg alt=dasjo presenting on #d8rules title=dasjo presenting on #d8rules height=360 width=240 class=panopoly-image-quarter media-element file-teaser panopoly-image-quarter src= //p pWe anticipate to use the budget raised by the end of 2014. Next year, we will have to look for further funding resources or limit work on Rules 8.x to our free time. Thanks again to a href= supporting us so far/a!/p pThere are already some great Drupal events lined up for next year where the #d8rules initiative will be present:/p pstrongDrupalCon Bogota, 10-12 of February 2014/strong will feature a full session on upgrading modules to integrate with Rules in Drupal 8 by dasjo: a href= - Web-automation with Rules in Drupal/a/p pstrongEuropean Drupal Days Milano, 19-21 of March 2015/strong  will include a a href=, training workshop amp; sprints/a provided by fago amp; dasjo./p pa href= us know/a if you want to get involved at any of these events and see you the core amp; Rules issue queues!/p pdasjo on behalf of the a href= team/a /p /div/div/div

Code Karate: Drupal 7 File Resumable Upload Module

Wed, 11/26/2014 - 16:04
div class=field field-name-field-episode-number field-type-number-integer field-label-abovediv class=field-labelEpisode Number:nbsp;/divdiv class=field-itemsdiv class=field-item even181/div/div/divdiv class=field field-name-field-ddod-video field-type-file field-label-hiddendiv class=field-itemsdiv class=field-item evenimg src= alt=Drupal 7 File Resumable Upload Module - Daily Dose of Drupal episode 181 //div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpThe Drupal 7 a href= rel=nofollowFile Resumable Upload Module/a is a great way to allow your Drupal site to upload large files. This is especially helpful if your server limits the size of files you can upload to your Drupal site. The module simply replaces the standard Drupal file upload field with a better alternative that allows:/p/div/div/divdiv class=field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/category/tags/drupalDrupal/a/divdiv class=field-item odda href=/category/tags/drupal/drupal-7Drupal 7/a/divdiv class=field-item evena href=/category/tags/drupal/file-managementFile Management/a/divdiv class=field-item odda href=/category/tags/drupal/mediaMedia/a/divdiv class=field-item evena href=/category/tags/drupal-planetDrupal Planet/a/div/div/div

David Norman: Acquia Certified Developer - Back end Specialist 2014 study guide

Wed, 11/26/2014 - 14:53
div class=field field-name-body field-type-text-with-summary field-label-hidden pI believe employers should be able to reliably expect that a person who has been certified by Acquia as a back end specialist have some actual experience with using, modifying, and extending Drupal in real-world projects. I don't think it would be appropriate to attempt this exam unless you've got emat least/em 6 months of intense, full-time Drupal experience. It's one thing to have read about codehook_menu/code, but this exam will expect that the examines know what sorts of options are in a particular hook, why you would use it, when and how to override it. Some of the questions are presented in a manner which a theoretical client is proposing a change to existing functionality or reporting a bug in custom code. Having experience to reference in responding to those situations would be helpful./p pscript async src=// !-- Nits mid-content -- ins class=adsbygoogle style=display:block data-ad-client=ca-pub-1105343943158891 data-ad-slot=4027080527 data-ad-format=auto/ins/p script (adsbygoogle = window.adsbygoogle || []).push({}); /script pThe exam was Drupal-centric. You shouldn't need to concern yourself with reviewing peripheral tools like a href=, a href=, a href=, a href=, a href=, a href=, a href=, a href=, a href=, a href=, a href=, a href=, IDEs, a href=, a href=, or any particular operating system./p pThe Back end Specialist exam doesn't ask questions on any particular contributed module like a href=, a href=, a href=, a href= Management/a, a href=, a href=, a href=, a href=, a href=, a href=, etc. a href= and a href= are absent, too. As I understand, contributed module questions may appear in the cross-discipline, general a href= Certified Developer/a exam as part of their Professional Track./p h2Domain 1.0: Fundamental Web Development Concepts/h2 pTo my dismay, the test authors really did ask front-end only questions specific to CSS and Javascript; I I think I got 3 of those. I think it detracts from the value of the exam - they could have asked more back end questions instead./p h31.1. Demonstrate knowledge of HTML and CSS/h3 pa href= h31.2. Identify PHP programing concepts/h3 ul lia href= lia href= lia href= lia href= /ul h31.3. Identify JavaScript and jQuery programing concepts/h3 pa href= h31.4. Demonstrate the use of Git for version control/h3 pBrush up on git functions that aren't necessarily common for day-to-day tasks./p h4Debugging/h4 ul lia href= lia href= /ul h4Administration/h4 ul lia href= lia href= lia href= lia href= /ul h2Domain 2.0: Drupal core API/h2 h32.1 Demonstrate an ability to register paths to define how URL requests are handled in Drupal using hook_menu and hook_menu_alter/h3 ul lia href=!system!system.api.php/function/hook_menu/7!system!system.api.php/function.../a/li lia href=!system!system.api.php/function/hook_menu_alter/7!system!system.api.php/function.../a/li /ul h32.2 Demonstrate ability to build, alter, validate and submit forms using Form API/h3 pa href= h32.3 Demonstrate ability to interact with the Node system using hook_node_*/h3 pa href=!node!node.api.php/group/node_api_hooks/7!node!node.api.php/group/node_a.../a/p h32.4 Demonstrate ability to interact with the Block system using hook_block_*/h3 ul lia href=!block!block.api.php/function/hook_block_info/7!block!block.api.php/function/h.../a/li lia href=!block!block.api.php/function/hook_block_info_alter/7!block!block.api.php/function/h.../a/li /ul h32.5 Demonstrate ability to use Core System hooks like hook_boot, hook_init, hook_cron, hook_mail, hook_file*/h3 pa href= h4Documentation/h4 ul lia href= lia href=!system!system.api.php/function/hook_init/7!system!system.api.php/function.../a/li lia href=!system!system.api.php/function/hook_mail_alter/7!system!system.api.php/function.../a/li /ul h4Example projects/h4 ul lia href= lia href= /ul h32.6 Determine order of hooks to enhance performance/h3 ul lia href= lia href=!system!system.api.php/function/hook_module_implements_alter/7!system!system.api.php/function.../a/li /ul h2Domain 3.0: Database Abstraction Layer/h2 h33.1 Demonstrate ability to work with Drupal's Database Abstraction Layer for managing tables/h3 ul lia href=!database!!database! lia href=!database!!database! /ul h33.2 Demonstrate ability to work with Drupal's Database Abstraction Layer CRUD operations on data/h3 ul lia href= lia href= /ul h2Domain 4.0: Debug code and troubleshooting/h2 h34.1 Demonstrate ability to debug code/h3 h34.2 Demonstrate ability to troubleshoot site problems/h3 pa href= h2Domain 5.0: Theme Integration/h2 h35.1 Demonstrate ability to work with Drupal's theme CSS and JavaScript APIs/h3 ul lia href= lia href= /ul h2Domain 6.0: Performance/h2 h36.1 Demonstrate ability to analyze and resolve site performance issues arising from site configuration/h3 pa href=!! h36.2 Demonstrate ability to analyze and resolve site performance issues arising from custom code/h3 h36.3 Implement Drupal caching strategies/h3 pa href= h2Domain 7.0: Security/h2 h37.1 Demonstrate ability to analyze and resolve security issues arising from site configuration/h3 pYou should review what each of the permissions give access to for core modules where multiple roles could be involved in publishing./p h37.2 Demonstrate ability to analyze and resolve security issues arising from site custom code/h3 h37.3 Demonstrate the abilty to implement Drupal core security mechanisms/h3 pa href= h2Domain 8.0: Community/h2 h38.1 Demonstrate the ability to contribute to the community/h3 pa href= h38.2 Demonstrate abiity to write code using Drupal Code standards/h3 pa href= /div !-- field.tpl -- div class=field field-name-taxonomyextra field-type-taxonomy-term-reference field-label-above labelPost categories/label div class=field-itemi class=fa fa-tag/i a href=/taxonomy/term/27Drupal/a/div /div