-
- Akihabara Electric Town (秋葉原電気街) (arcade, games, fun).
- Origami Museum (おりがみ会館) (Origami history and classes).
- Yodobashi Akiba (ヨドバシカメラ) (shopping, electronics, makeup, games, souvenirs, etc).
-
- Coco ichiban (Curry with rice, vegetarian options available).
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
defmodule MyApp.Blog.Author do | |
use Ecto.Schema | |
import Ecto.Changeset | |
schema "authors" do | |
field :name, :string | |
field :email, :string | |
# ... | |
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
# boolean values, use if | |
if expression, do: this(), else: that() | |
# non-boolean multi-value single expressions, use case | |
case expression do | |
value1 -> one() | |
value2 -> two() | |
value3 -> three() | |
_ -> anything_else() | |
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
defmodule MyModule do | |
# this is valid sytax. However, you can't access x and my_function inside `def` | |
x = 2 | |
my_function = fn (x) -> x * 2 end | |
# this is valid syntax. It will replace @my_variable with 2 anywehre inside the module at compile time. | |
@my_variable 2 | |
# the following line will not compile | |
# because only the following values are supported here: |
I have been struggling (unnecessarily) to make my NativeScript app work seamlessly with Phoenix Channels.
I'm sure this is not the perfect solution, but after trying a lot of other solutions and none of them worked, this one worked for me like a charm.
I'm using:
- macOS 10.12.6
- phoenix 1.3.0
- NativeScript 3.1.3
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
# Scenario ONE | |
price = Decimal(33.000) # <-- passed in a number | |
factor = Decimal(0.3020) | |
price = price / factor | |
price = price * factor | |
price.quantize(Decimal("0.01"), rounding=ROUND_UP) # --> 33 | |
# Scenario TWO | |
price = Decimal('33.000') # <-- passed in a string | |
factor = Decimal('0.3020') |
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
Abdullahs-iMac-2:GM abdullah$ bundle update | |
Fetching gem metadata from https://rubygems.org/............ | |
Fetching version metadata from https://rubygems.org/... | |
Fetching dependency metadata from https://rubygems.org/.. | |
Resolving dependencies... | |
Using rake 10.4.2 | |
Using i18n 0.7.0 | |
Using json 1.8.3 | |
Using minitest 5.7.0 | |
Using thread_safe 0.3.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
def application(app, didReceiveLocalNotification: notification) | |
if app.applicationState == UIApplicationStateInactive | |
NSLog("didReceiveLocalNotification...") | |
url = NSURL.URLWithString("sms:12345678") | |
NSLog("finished creating URL...") | |
app.openURL(url) | |
NSLog("opened URL... Done.") | |
elsif app.applicationState == UIApplicationStateActive | |
App.alert(notification.alertBody) | |
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
# controller | |
def create | |
user = User.create(params[:user]) | |
respond_with(user, include: :extras) | |
end | |
# nginx conf | |
server { | |
listen 80; |
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
// BackgroundLayer | |
-(id) init { | |
self = [super init]; | |
if(self != nil) { | |
CCSprite *backgroundImage; | |
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
backgroundImage = [CCSprite spriteWithFile:@"background.png"]; | |
} else { | |
backgroundImage = [CCSprite spriteWithFile:@"backgroundiPhone.png"]; | |
} |
NewerOlder