Shortcut to perform a Google I'm Feeling Lucky search on https://developer.mozilla.org.
A number of fonts are available by default based on the platform (e.g., Roboto on Android, Helvetica on iOS). See the full list here.
This file contains 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
wget http://download.virtualbox.org/virtualbox/4.3.12/VBoxGuestAdditions_4.3.12.iso | |
sudo mkdir /media/iso | |
sudo mount -o loop ./VBoxGuestAdditions_4.3.12.iso /media/iso | |
sudo bash /media/iso/VBoxLinuxAdditions.run --nox11 | |
sudo umount /media/iso |
This file contains 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
// Return the "pivot index" of the given array of numbers. The pivot index is | |
// the index where the sum of the numbers on the left is equal to the sum of | |
// the numbers on the right. | |
function pivot(numbers) { | |
validateInput(numbers); | |
// Find a pivot index by testing each index | |
for (var i = 0; i < numbers.length; i++) { | |
var leftSum = sum(numbers.slice(0, i)); | |
var rightSum = sum(numbers.slice(i + 1)); |
This file contains 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
# Determines how many cpus the virtual machine should be given. Uses half of | |
# what's available on the host with a default of 4. | |
def numvcpus | |
begin | |
os_cpu_cores / 2 | |
rescue | |
4 | |
end | |
end |
className
attribute instead ofclass
htmlFor
attribute instead offor
<textarea value="something">
instead of<textarea>something</textarea>
(see Why Textarea Value)<select value="something"><option value="something"></select>
instead of<select><option selected value="something"></select>
(see Why Select Value)- Whitespace (see discussion)
- [Tags must be closed and all tags can be self-closing][closing tags]
This file contains 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
class Plugin < ::Vagrant.plugin("2") | |
name "build" | |
action_hook('build') do |hook| | |
hook.after(Vagrant::Action::Builtin::Provision, 2) do | |
system("bash build.sh") | |
end | |
end | |
end |
This file contains 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
const t = require('babel-types'); | |
const assert = require('assert'); | |
/** | |
* Is `module.exports` expression | |
*/ | |
const isModuleExportsMemberExpression = (node) => { | |
t.assertMemberExpression(node); | |
t.assertIdentifier(node.object); | |
assert.equal(node.object.name, 'module'); |
NewerOlder