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
""" | |
Copyright 2019 Jason Hu <awaregit at gmail.com> | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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 Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
export default class ApplicationController extends Controller { | |
queryParams = ['myArray']; | |
// The default value being an array is important. Changing this | |
// to anything else fixes the problem. | |
@tracked myArray = []; | |
} |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
init() { | |
this._super(...arguments); | |
this.set('range', Array(5)); | |
}, | |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
fields: Ember.A(), | |
actions: { | |
addField() { | |
this.get('fields').insertAt(0, { label: '1' }); |
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
def method_defined_within?(name, klass, superklass = klass.superclass) # :nodoc: | |
if klass.method_defined?(name) || klass.private_method_defined?(name) | |
if superklass.method_defined?(name) || superklass.private_method_defined?(name) | |
klass.instance_method(name).owner != superklass.instance_method(name).owner | |
else | |
true | |
end | |
else | |
false | |
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
// 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 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 'active_record' | |
require 'minitest/autorun' | |
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: 'foobar.db' | |
class Record < ActiveRecord::Base | |
connection.create_table table_name, force: true do |t| | |
t.string :name | |
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
On Feb 20, 2009, at 4:24 PM, "Olusegun A.A" <[email protected]> wrote: | |
** CRAIGSLIST ADVISORY --- AVOID SCAMS BY DEALING LOCALLY | |
** Avoid: wiring money, cross-border deals, work-at-home | |
** Beware: cashier checks, money orders, escrow, shipping | |
** More Info: http://www.craigslist.org/about/scams.html | |
Hello, | |
Do you still have this item available for sale at the moment? Get back asap. |