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
$filter1 = $data | |
->where(function($row) | |
{ | |
return $row['price'] > 90 && $row['price'] < 99; | |
}) | |
->orderByDescending(function($row) | |
{ | |
return $row['id']; | |
}); |
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
console.log(process.argv.splice(2) | |
.reduce(function(a, b) { | |
return Number(a) + Number(b) | |
})); | |
var total = 0; | |
for (var i = 2; i < process.argv.length; i++) { | |
total += parseInt(process.argv[i]); | |
} | |
console.log(total); |
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
console.log(process.argv.slice(2) | |
.reduce(function(a, b) { | |
return Number(a) + Number(b) | |
})); | |
var total = 0; | |
for (var i = 2; i < process.argv.length; i++) { | |
total += parseInt(process.argv[i]); | |
} | |
console.log(total); |
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
var li = [5,6,4,9,3]; | |
function min(a, b) { | |
return a < b ? a : b; | |
} | |
// reduce is an awesome function. in this situation it's doing: | |
// min(5,6) -> 5... min(5,4) -> 4... min(4,9) -> 4... min(4,3) -> 3... done | |
// you provide a function that takes two arguments and it goes through the list, | |
// using the return value as one of the arguments and the next list element as the other. |
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
select t.TeamName, ifnull(Wins, 0) Wins, ifnull(Total-Wins,0) Losses | |
from Team t | |
left join ( | |
select b.TeamID, count(*) Wins | |
from ( | |
select a.GameID, a.TeamID, max(Points) | |
from ( | |
select gf.GameID, gf.TeamID, sum(gf.FirstRoll + gf.SecondRoll) Points | |
from GameFrame gf | |
group by gf.GameID, gf.TeamID |
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
type Meters = { meters: number }; | |
type Feet = { feet: number }; | |
type Distance = Meters | Feet; | |
function isMeters(distance: Distance): distance is Meters { | |
return typeof (distance as Meters).meters === 'number'; | |
} | |
function isFeet(distance: Distance): distance is Feet { | |
return typeof (distance as Feet).feet === 'number'; | |
} |
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
type Meters = { meters: number }; | |
type Feet = { feet: number }; | |
type Distance = Meters | Feet; | |
function isMeters(distance: Distance): distance is Meters { | |
return typeof (distance as Meters).meters === 'number'; | |
} | |
function isFeet(distance: Distance): distance is Feet { | |
return typeof (distance as Feet).feet === 'number'; | |
} |
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
The invocation that failed: | |
$ brew search gcc | |
Error: stack level too deep | |
Please report this bug: | |
https://git.io/brew-troubleshooting | |
/usr/local/Library/Homebrew/formulary.rb:21 | |
----- brew config ----- | |
HOMEBREW_VERSION: 0.9.5 |
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
interface Point { | |
row: number | |
column: number | |
someOtherShitThatAtomUses: idk | |
color: string | |
} | |
var doStuffWithPoint(point: { row: number, column: number}) { | |
... | |
} |
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
! function(e, a) { | |
"object" == typeof exports && "undefined" != typeof module ? a(exports, require("ms-rest-azure-js"), require("ms-rest-js")) : "function" == typeof define && define.amd ? define(["exports", "ms-rest-azure-js", "ms-rest-js"], a) : a(e.ArmStorage20180301Preview = {}, e.msRestAzure, e.msRest) | |
}(this, function(e, a, t) { | |
"use strict"; | |
var r = function(e, a) { | |
return (r = Object.setPrototypeOf || { | |
__proto__: [] | |
} | |
instanceof Array && function(e, a) { | |
e.__proto__ = a |
OlderNewer