Skip to content

Instantly share code, notes, and snippets.

View stevekinney's full-sized avatar

Steve Kinney stevekinney

View GitHub Profile
var firstList = ["A", "B", "C", "D", "E", "F"];
var secondList = ["C", "E", "F"];
function filterOut(firstList, secondList) {
return firstList.filter(function (listItem) {
var includedInSecondList = false;
secondList.forEach(function (itemInSecondList) {
if (listItem === itemInSecondList) includedInSecondList = true;
});
return !includedInSecondList;
function palindrome(word) {
word = word.toLowerCase().replace(/\W/g, '');
return word === word.split('').reverse().join('');
}
console.assert(palindrome('Racecar'));
console.assert(palindrome('A car, a man, a maraca.'));
console.assert(palindrome('Borrow or rob?'));
console.assert(palindrome('Cigar? Toss it in a can. It is so tragic.'));
console.assert(palindrome('Dr. Awkward'));
function isALeapYear(year) {
if (year % 400 === 0) return true;
if (year % 100 === 0) return false;
if (year % 4 === 0) return true;
}
function leapYears(number, year, years) {
year = year || (new Date).getFullYear();
years = years || [];
if (isALeapYear(year)) years.push(year);
[1] pry(main)> regdate = "11/12/2008 10:47:00"
=> "11/12/2008 10:47:00"
[2] pry(main)> r = regdate.split(' ')
=> ["11/12/2008", "10:47:00"]
[3] pry(main)> r[0]
=> "11/12/2008"
[4] pry(main)>
  • Ember Fundamentals (2 hours)
    • The Ember landscape
      • ember-cli
      • Ember Inspector
        • Analyzing our routes
        • Sending a variable to the console
    • Dynamic generation
      • Application and Index
      • In-memory routes, controllers, and views
  • Ember Routing
1959-09-07
1998-08-18
14*08*1986
21*11*1978
06#76#03
02#76#13
03#29#14
06*06*1970
09#51#03
1969-09-21
09#65#21
06#72#03
Dec 26, 75
Jul 13, 07
Nov 21, 14
15*10*1981
13*02*1992
10#51#16
1964-01-10
06*04*1965

PG on DigitalOcean

Things we did while debugging our postgresql server on Digital Ocean (documenting b/c who knows, we might need again, or others might).

We did this while going through this tutorial

Set env to production

[
{
"company": "3M",
"description": "3M, based in Minnesota, may be best known for its Scotch tape and Post-It Notes, but it also produces sand paper, adhesives, medical products, computer screen filters, food safety items, stationery products and many products used in automotive, marine, and aircraft industries.",
"initial_price": 44.28,
"price_2002": 56.27,
"price_2007": 95.85,
"symbol": "MMM"
},
{
---
-
company: "3M"
description: "3M, based in Minnesota, may be best known for its Scotch tape and Post-It Notes, but it also produces sand paper, adhesives, medical products, computer screen filters, food safety items, stationery products and many products used in automotive, marine, and aircraft industries."
initial_price: 44.28
price_2002: 56.27
price_2007: 95.85
symbol: "MMM"
-
company: "Amazon.com"