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 Math do | |
| @spec factorial(pos_integer) :: pos_integer | |
| @doc "Compute factorial" | |
| def factorial(0), do: 1 | |
| def factorial(n) when n > 0 do | |
| n * factorial(n - 1) | |
| end | |
| end | |
| Math.factorial(10) |
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
| <div id="app"> | |
| <input @keyup.enter="trigger" placeholder="Reply here" class="fb-comment-input" v-model="buffer_input" /> | |
| <i class="fb-send" @click="enterClicked" ref="sendReply">⇨</i> | |
| <div>{{ dato }}</div> | |
| </div> | |
| new Vue({ | |
| el:'#app', | |
| data: { | |
| buffer_input: '', |
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
| package com.lab.experiment | |
| fun nextTen( itemDigit: Int ): Int { | |
| return ( ( itemDigit / 10 ) + 1 ) * 10 | |
| } | |
| fun validationDigit( itemDigit: Int ): Int { |
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
| #!/usr/bin/env python2 | |
| """ | |
| Other Repositories of python-ping | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| * https://github.com/l4m3rx/python-ping supports Python2 and Python3 | |
| * https://bitbucket.org/delroth/python-ping |
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
| fn main() { | |
| for index in 0..10 { | |
| println!("{}", "*".repeat(index)); | |
| } | |
| } | |
| /** | |
| Standard Output | |
| * |
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
| IEx.configure( | |
| colors: [ enabled: true], | |
| default_prompt: [ | |
| "\e[G", # move to column 1 | |
| "\e[35m", # magenta | |
| "λ(%counter)", #%prefix show the iex name iex(1)> in the console | |
| ">", | |
| "\e[0m" # reset | |
| ] |> IO.chardata_to_string | |
| ) |
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
| <template> | |
| <div class="clock"> | |
| {{ tiempos }} | |
| </div> | |
| </template> | |
| <script> | |
| import moment from 'moment' | |
| moment.locale('es') | |
| const defaultFormat ='D. MMMM YYYY H:mm:ss' | |
| var data = { |
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
| fn multiply(num: i32) -> i32 { | |
| // time to code | |
| (1..num).filter(|x| x % 3 == 0 || x % 5 == 0 ).sum() | |
| } | |
| fn main(){ | |
| println!("{}",multiply(10)); | |
| } |
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
| from PIL import Image | |
| def webp2png(webpfile): | |
| image = Image.open(webpfile) | |
| filename = image.filename.split('.')[0] | |
| filepath = "/tmp/{}.png".format(filename) | |
| image.save(filepath, 'png') |
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
| pyramid = lambda{|rows| rows.times do |i| puts '*'*(i+1) end} | |
| pyramid.(10) | |
| =begin | |
| My output | |
| [wilo@developer ~]$ ruby pyramid.rb | |
| * | |
| ** | |
| *** | |
| **** |