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
| #!/bin/bash | |
| # POSIX command lookup example | |
| CMDS="tar /usr/bin/mysqldump /path/to/other/command" | |
| for i in $CMDS | |
| do | |
| # command -v will return >0 when the $i is not found | |
| command -v $i >/dev/null && continue || { echo "$i command not found."; exit 1; } | |
| done | |
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
| header('HTTP/1.1 304 Not Modified');exit(); |
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
| :vert sb N | |
| which will open a left vertical split (by default, unless you have modified some options). | |
| To open a split to the right, on the other hand: | |
| :vert belowright sb N |
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
| html, body { | |
| height: 100%; | |
| } | |
| body { | |
| margin: 0; | |
| background: #0A539C; | |
| background: linear-gradient(top, #4293d6 0%,#001e96 100%); | |
| overflow: hidden; | |
| } |
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
| module.exports = { | |
| 'can log in at vimeo': function (test) { | |
| 'use strict'; | |
| test.expect(1) | |
| .open('http://vimeo.com/log_in') | |
| .type('#email', 'foo@bar.com') | |
| .type('#password', 'baz') | |
| .click('.submit .btn') | |
| .assert.text('#page_header h1 a', 'foobar') |
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
| describe('Test example.com', function(){ | |
| before(function(done) { | |
| client.init().url('http://example.com', done); | |
| }); | |
| describe('Check homepage', function(){ | |
| it('should see the correct title', function(done) { | |
| client.getTitle(function(err, title){ | |
| expect(title).to.have.string('Example Domain'); | |
| done(); |
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
| function set_headers($file, $timestamp) { | |
| $gmt_mtime = gmdate('r', $timestamp); | |
| header('ETag: "'.md5($timestamp.$file).'"'); | |
| header('Last-Modified: '.$gmt_mtime); | |
| header('Cache-Control: public'); | |
| if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) { | |
| if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] == $gmt_mtime | |
| || str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == md5($timestamp.$file)) { | |
| header('HTTP/1.1 304 Not Modified'); | |
| exit(); |
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
| config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset' --abbrev-commit" |
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
| if (!Function.prototype.bind) { | |
| Function.prototype.bind = function (oThis) { | |
| if (typeof this !== "function") { | |
| // closest thing possible to the ECMAScript 5 | |
| // internal IsCallable function | |
| throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); | |
| } | |
| var aArgs = Array.prototype.slice.call(arguments, 1), | |
| fToBind = this, |