Skip to content

Instantly share code, notes, and snippets.

View WandersonAlves's full-sized avatar
:shipit:
Coding

Wanderson Alves WandersonAlves

:shipit:
Coding
View GitHub Profile
@WandersonAlves
WandersonAlves / float.rb
Last active October 2, 2015 20:49
Convert decimal to degrees (modified from https://gist.github.com/laurynas/519740)
class Float
# Convert decimal to degrees, minutes, seconds sexagesimal
# (used for GPS coordinates)
def to_sexagesimal type
direction = nil
if type == 'lat'
direction = self.positive? ? 'N' : 'S'
elsif type == 'long'
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@WandersonAlves
WandersonAlves / algo.js
Last active September 15, 2017 19:27
Computed props
computed: {
strokeDashoffset() {
return DEFAULT_SIZE * (1 - (this.computedPercentage / 100));
},
xAxis() {
if (this.computedPercentage >= 100) {
return TREE_DIGITS_X_AXIS;
} else if (this.computedPercentage >=0 && this.computedPercentage <=9) {
return ONE_DIGITS_X_AXIS;
}
@WandersonAlves
WandersonAlves / index.js
Created June 30, 2018 23:02
#1 async/await/then leasson
( async () => {
const pegarAsyncPromise = (id) => {
return new Promise((resolve, reject) => {
if (id % 2 === 0) {
resolve(true);
}
else {
reject(false);
}
});

Um gerador de código customizavel

sinopse

Uma ferramenta instalavel nos projetos que tenha o poder de criar arquivos templates comum

  • componentes react
  • classes node
  • componentes vue
  • readme xingando o papa
@WandersonAlves
WandersonAlves / main.java
Last active April 9, 2020 19:12
Ifs com Helder
import java.util.Scanner;
public class condici {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double l1, l2, l3;
System.out.println("É triângulo?");