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
| /** | |
| * Just a simple demonstration after seeing an answer on StackOverflow relating to code auditing which despite | |
| * gathering the most votes by far (currently 23) includes the following clearly inaccurate statement without | |
| * a single comment pointing out the inaccurate claim. | |
| * | |
| * ======================================================================================================== | |
| * Quote from the current top answer on http://stackoverflow.com/questions/4273244/auditing-a-php-codebase: | |
| * ======================================================================================================== | |
| * Accidental Assignment — More often than not, you'll see this happen in some non-critical component of the | |
| * code, where it can sleep and/or lurk until you get an unexpected result one day: if ($foo = $this->bar()). |
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 | |
| testGlobal=0; | |
| updateGlobal(){ | |
| testGlobal=50; | |
| echo "World!"; | |
| } | |
| #Output the return value directly |
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
| @import "compass/css3/box-shadow" | |
| @import "compass/css3/transition" | |
| $bs-box-shadow-default-color: rgba(0, 0, 0, 0.075) | |
| $bs-box-shadow-focus-color: rgb(82, 168, 236) | |
| @mixin bs-default-box-shadow | |
| @include box-shadow(inset 0 1px 1px $bs-box-shadow-default-color) | |
| @mixin bs-box-shadow |
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
| [:first_name=, :last_name=].each do |current| | |
| alias_attribute current, :read_only | |
| end | |
| protected | |
| def read_only attribute | |
| attribute_name = caller[0][/`([^=']*)='/, 1] # Matches after first ` until = or ' is reached. | |
| error_message = "sorry #{attribute_name} is read-only" | |
| self.errors.add(attribute_name, error_message) | |
| end |
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
| me@debian:/storage/webstore$ sudo ./rvm.sh stable --ruby=1.9.3 --debug | |
| Turning on debug mode. | |
| Running(1): Selected RVM branch stableDownloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz | |
| Running(1): Running(15): curl --fail --location --max-redirs 10 --connect-timeout 30 --retry-delay 2 --retry 3 -sS https://github.com/wayneeseguin/rvm/archive/stable.tar.gz -o /usr/local/rvm/archives/rvm-stable.tgzRunning(1): Running(6): tar xzf /usr/local/rvm/archives/rvm-stable.tgz --no-same-owner --strip-components 1step> 'system_installation_check' started | |
| step< 'system_installation_check' finished with status 0 in 0.001156285 seconds | |
| step> 'setup_rvm_group_and_users' started | |
| Group 'rvm' already exists | |
| step< 'setup_rvm_group_and_users' finished with status 0 in 0.002343942 seconds | |
| step> 'print_install_header' started | |
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
| require "delegate" | |
| class CollectionProxy | |
| def products | |
| @products ||= HasManyAssociation.new([]) | |
| @products.associated_class ||= Product | |
| @products | |
| end | |
| end | |
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
| irb(main):017:0> val = RBENV_VERSI0N | |
| NameError: uninitialized constant RBENV_VERSI0N | |
| from (irb):17 | |
| from /Users/gerardcaulfield/.rbenv/versions/2.1.2/bin/irb:11:in `<main>' # Fair enough | |
| irb(main):018:0> val = rbenv_versi0n | |
| NameError: undefined local variable or method `rbenv_versi0n' for main:Object | |
| from (irb):18 | |
| from /Users/gerardcaulfield/.rbenv/versions/2.1.2/bin/irb:11:in `<main>' # Oh right |
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 Engine = require('famous/core/Engine'); | |
| var Surface = require('famous/core/Surface'); | |
| var StateModifier = require('famous/modifiers/StateModifier'); | |
| var Transform = require('famous/core/Transform'); | |
| var mainContext = Engine.createContext(); | |
| function translateModifier(){ | |
| return new StateModifier({ | |
| transform: Transform.translate(200, 0, 0) |
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
| $scope.weatherResult = $scope.weatherApi.get( | |
| { q: $scope.city, cnt: 2 }, | |
| function(result) { | |
| console.log(result) | |
| } | |
| ); |
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
| <span ng-repeat="numDays in [1,2,5,7,10,13,17]"> | |
| <a href="#/forecast/{{numDays}}" ng-class="{'bg-primary': numDays===days}">{{numDays}}</a> | |
| <span ng-show="!$last"> | </span> | |
| </span> |
OlderNewer