#Fizz Buzz
- weslley39
- lnmunhoz
##Elixir
defmodule FizzBuzz do
def run(n) when (rem(n, 3) == 0) and (rem(n, 5) == 0) do
IO.puts("FizzBuzz")
license: mit |
#Fizz Buzz
##Elixir
defmodule FizzBuzz do
def run(n) when (rem(n, 3) == 0) and (rem(n, 5) == 0) do
IO.puts("FizzBuzz")
Atom linter-eslint has a very handy command to fix the file with specified linting rules.
You can lint your file with by calling Command + P and typing Fix.
This saves time but you still need to type Fix over and over again to fix your file. Its more time saving if you could lint your file on saving, right? You can!
There's two ways you can config this behaviour. Follow the method that most please you:
/** | |
* Lucas Nogueira Munhoz | |
* Start: 08:40AM - End: 10:03AM | |
*/ | |
// units.js | |
const units = { second: 1000 }; | |
units.minute = 60 * units.second; | |
units.hour = 60 * units.minute; | |
units.day = 24 * units.hour; |
From Meteor's documentation:
In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.
This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.
Sometimes we need to run async code in Meteor.methods
.
For this we create a Future
to block until the async code has finished.
public string ByteArrayToString(byte[] ba) | |
{ | |
StringBuilder hex = new StringBuilder(ba.Length * 2); | |
foreach (byte b in ba) hex.AppendFormat("{0:x2}", b); | |
return hex.ToString(); | |
} |
// file is our stream | |
var fileStream = File.Create(@"..\"+ file.FileName, (int) file.Length); | |
var bytesInStream = new byte[file.Length]; | |
file.Read(bytesInStream, 0, bytesInStream.Length); | |
fileStream.Write(bytesInStream, 0, bytesInStream.Length); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="author" content="lnmunhoz"> | |
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/2.1.0/knockout-min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1/Chart.js"></script> |
'use strict'; | |
var express = require('express'); | |
var app = express(); | |
var server = require('http').Server(app); | |
var bodyParser = require('body-parser'); | |
var port = process.env.PORT || 3000; | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({extended: true})); |