Skip to content

Instantly share code, notes, and snippets.

@ismarsantos
ismarsantos / Variacao_Percentual.js
Last active August 29, 2015 14:17
Variação Percentual algoritmo.
calcular = function(v1,v2,variacao_tolerada) {
var variacao = ((v1 / v2 ) * 100) - 100;
var variacao = parseFloat(variacao).toFixed(2);
if ((variacao > variacao_tolerada) || ((variacao < -variacao_tolerada))) {
console.log( "O Valor " + v1 + " em relação à " + v2 + " encontra-se fora da variação máxima: " + variacao_tolerada + "\n Variação calculada:" + variacao)
} else {
console.log( "O Valor " + v1 + " em relação à " + v2 + " encontra-se dentro da variação máxima de: " + variacao_tolerada + "\n Variação calculada:" + variacao_negativa)
}
require "bundler/capistrano"
# General
set :application, "application_name"
set :domain, "www.your_domain.com"
set :user, "deploy"
set :runner, "deploy"
set :use_sudo, false
set :deploy_to, "/var/www/#{application}"
set :repository_cache, "#{application}_cache"
@ismarsantos
ismarsantos / ubuntu14.04-command-line-install-android-sdk
Created May 23, 2016 20:12 — forked from shark0der/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk (platform & platform-tools only, no emulator)
# install java
apt-get install -y software-properties-common
apt-add-repository -y ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
# download latest android sdk
# http://developer.android.com/sdk/index.html#Other
cd /opt
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* 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
We couldn’t find that file to show.
Run this command to install MG-CLI:
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb
to start miner (4 cores for BCN) use this command:
minergate-cli -user <YOUR@EMAIL.KAPPA> -bcn 4
Feel free to send some of your earnings to me:
BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j
Try this:
Switch on your computer. Boot into a Ubuntu Live DVD/USB
After the load, open a terminal,
Press Ctrl+Alt+T
Run in it:
@ismarsantos
ismarsantos / gist:24c726cbfcba7c5596fdee4bea6734e8
Created September 13, 2017 14:23
ExecJS::ProgramError: Unexpected token running rake assets:precompile on production
A more universal way to find the problem in js-assets: Run rails console and:
JS_PATH = "app/assets/javascripts/**/*.js";
Dir[JS_PATH].each do |file_name|
puts "\n#{file_name}"
puts Uglifier.compile(File.read(file_name))
end
@ismarsantos
ismarsantos / comoNaoDeixarNoVaucoNoWhatsapp.js
Created October 23, 2017 03:22 — forked from callmeloureiro/comoNaoDeixarNoVaucoNoWhatsapp.js
Como não deixar no vácuo no whatsapp
/*
Hoje não deixaremos mais ninguém no vácuo no whatsapp
Para utilizar:
- Abra o web.whatsapp.com;
- Abra o console e cole o código que está no gist;
- Aguarde e verá uma mensagem sendo enviada a cada momento que alguém te enviar alguma mensagem.
Confira também como ser chato no whatsapp: https://gist.github.com/mathloureiro/4c74d60f051ed59650cc76d1da0d32da
@ismarsantos
ismarsantos / __readme.md
Created December 6, 2017 01:07 — forked from maxivak/__readme.md
Tree with ancestry. Rails

Contents:

  • show full path for the item
  • show tree in ol li
  • show tree in dropdown select

Show full path for item

  • one item