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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
purchases: Ember.computed.alias('model.purchase') | |
}); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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() { | |
var player1 = new player('Federico', 'Bucchi', 'X'); | |
var player2 = new player('Mac', 'BookPro', 'O'); | |
var wins = [ | |
[1, 2, 3], | |
[4, 5, 6], | |
[7, 8, 9], | |
[1, 4, 7], | |
[2, 5, 8], | |
[3, 6, 9], |
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
Verifying I am +federicobucchi on my passcard. https://onename.com/federicobucchi |
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 test1 = { 30: 'Template A', 60: 'Template B', 10: 'Template C' }; | |
var test2 = { 30: 'Template A', 70: 'Template B' }; | |
var test3 = { 'A': 50, 'B': 50 }; | |
function selectEnv(templates) { | |
var newTemplates = {}; | |
var tot = 100; | |
var random = Math.floor(Math.random() * 100); | |
var i; |
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 isValidCreditCard = function (card) { | |
// Array I want to use to keep the transformed digits | |
var momentaryCard = []; | |
// Sum of transformed digits | |
var sum = 0; | |
// Card length | |
var cardLength = card.length; |
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 countPrimes = function(n) { | |
var counter = 0; | |
var input = n - 1; | |
var isPrime = function(input) { | |
var square; | |
if (isNaN(input) || !isFinite(input) || input % 1 || input < 2) { | |
return false; |
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 isHappy = function(n) { | |
var arr = n.toString().split(''); | |
var times = 0; | |
var exp; | |
var scan = function(arr) { | |
exp = 0; | |
times += 1; |
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 arr = ['f', 'e', 'd'] | |
var lazy = (function(){ | |
var counter = 0; | |
return function(){ | |
console.log(arr[counter]); | |
counter += 1; |
NewerOlder