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
| var Foo = function(){ | |
| this.par = 3; | |
| this.sub = new(function(t){ //using virtual function to create sub object and pass parent object via 't' | |
| this.p = t; | |
| this.subFunction = function(){ | |
| alert(this.p.par); | |
| } | |
| })(this); | |
| } |
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 sum(a, b, c, d) { | |
| // Note: no `break` needed | |
| switch (arguments.length) { | |
| case 0: a = 1; | |
| case 1: b = 2; | |
| case 2: c = 3; | |
| case 3: d = 4; | |
| } | |
| return a + b + c + d; | |
| } |
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 | |
| /** | |
| * GitHub webhook handler template. | |
| * | |
| * @see https://developer.github.com/webhooks/ | |
| * @author Miloslav Hůla (https://github.com/milo) | |
| */ | |
| $hookSecret = 's.e.c.r.e.t'; # set NULL to disable check |
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
| sudo mkdir -m 0700 /var/www/.ssh | |
| sudo chown -R ubuntu:www-data /var/www/.ssh | |
| # one problem here is I do not know who the exec command is executing as. | |
| sudo -u ubuntu ssh-keygen (empty passphrase) | |
| sudo -u ubuntu ssh -T [email protected] | |
| # this adds git to the recognized list of /var/www/.ssh/known_hosts | |
| # paste public key into repo manager | |
| cd (git repo) | |
| sudo -u apache git pull origin branch |
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 -n -l -d display_errors -d display_startup_errors path/to/your/phpfile.php |
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
| # https://github.com/causes/scss-lint/tree/master/lib/scss_lint/linter | |
| exclude: 'app/assets/stylesheets/settings/*' | |
| linters: | |
| BorderZero: | |
| enabled: true | |
| ColorKeyword: | |
| enabled: false | |
| Comment: |
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
| // Code goes here | |
| (function testInheritance(global, doc, $) { | |
| "use strict"; | |
| var MyFunc = Object.create({}, { | |
| _foo: { | |
| value: null, | |
| writable: true, | |
| enumerable: 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 | |
| /** | |
| * Class CachedPDOStatement | |
| * | |
| * CachingIterator for a PDOStatement | |
| */ | |
| class CachedPDOStatement extends CachingIterator | |
| { | |
| private $index; |
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
| Works in javascript or PHP. | |
| var foo = "foo"; | |
| if (~foo.indexOf("f")) { | |
| console.log(~foo.indexOf("f")); | |
| console.log("Found it!"); | |
| } | |
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
| SSLEngine on | |
| SSLProtocol -ALL +TLSv1.2 | |
| SSLHonorCipherOrder On | |
| SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:EECDH+AES:EDH+AES:AESGCM:AES:-SSLv3:EECDH+AES:EECDH+3DES:kRSA+AES:EDH+AES:EDH+3DES:3DES:!NULL:!ADH:!kECDH:!DSS:!MD5:!PSK:!aNULL:!SRP:!DES:!EXP:!RC4 | |
| SSLCompression off |