01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140
Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.
[Laughter]
| Disable vim automatic visual mode on mouse select | |
| issue: :set mouse-=a | |
| add to ~/.vimrc: set mouse-=a | |
| my ~/.vimrc for preserving global defaults and only changing one option: | |
| source $VIMRUNTIME/defaults.vim | |
| set mouse-=a |
| <?php | |
| return Symfony\CS\Config\Config::create() | |
| ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) | |
| ->fixers([ | |
| 'short_array_syntax', | |
| 'ordered_use', | |
| ]) | |
| ; |
Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.
To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js
(I may be using incorrect terms below, please forgive me)
| #!/usr/bin/env python | |
| #-*- coding: utf-8 -*- | |
| """A post-update Git hook to execute `composer install` when composer.json changes | |
| :Author: Cody Halovich | |
| :Company: HootSuite Media Inc. | |
| """ | |
| import subprocess |
| <?php | |
| use Zend\Console\Console; | |
| $config = array( | |
| 'modules' => array( | |
| 'Application', | |
| 'DoctrineModule', | |
| 'DoctrineORMModule', | |
| // ... |
| # | |
| # Working with branches | |
| # | |
| # Get the current branch name (not so useful in itself, but used in | |
| # other aliases) | |
| branch-name = "!git rev-parse --abbrev-ref HEAD" | |
| # Push the current branch to the remote "origin", and set it to track | |
| # the upstream branch | |
| publish = "!git push -u origin $(git branch-name)" |
| # Apache configuration file | |
| # httpd.apache.org/docs/2.2/mod/quickreference.html | |
| # Note .htaccess files are an overhead, this logic should be in your Apache | |
| # config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html | |
| # Techniques in here adapted from all over, including: | |
| # Kroc Camen: camendesign.com/.htaccess | |
| # perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ | |
| # Sample .htaccess file of CMS MODx: modxcms.com | |
| # This is the free sample of .htaccess from 6GO s.r.l. | |
| # @author Claudio Ludovico Panetta (@Ludo237) |
Problem: When linking to the raw version of a gist, the link changes with each revision.
Solution:
To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/
To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]