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
| console.log('Loading function'); | |
| const https = require('https'); | |
| const url = require('url'); | |
| // to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
| const slack_url = 'https://hooks.slack.com/services/...'; | |
| const slack_req_opts = url.parse(slack_url); | |
| slack_req_opts.method = 'POST'; | |
| slack_req_opts.headers = {'Content-Type': 'application/json'}; |
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
| #user_emails = LER_DO_CSV | |
| # ex: | |
| user_emails = [" milene.sempre@hotmail.com"," mileniumsp@yahoo.com.br"] | |
| user_emails.each do |user_email| | |
| correct_user_email = user_email.lstrip | |
| # busca o usuario | |
| correct_user = SellerAggregator::Evmain::UsuarioRecord.find_by_email(correct_user_email) |
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
| # print "Integer please: " | |
| # user_num = Integer(gets.chomp) | |
| # IF | |
| user_num = 80 | |
| if user_num < 0 | |
| puts "You picked a negative integer!" | |
| elsif user_num > 0 | |
| puts "You picked a positive integer!" |
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
| class Dummy | |
| def self.class_var | |
| @@var | |
| end | |
| def self.class_var=value | |
| @@var=value | |
| end | |
| def my_method |
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
| # Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux | |
| # Log in as root | |
| # Mount ramdisk folder in RAM | |
| mkdir /tmp/ramdisk | |
| mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/ | |
| # Move MySQL data | |
| mv /var/lib/mysql /tmp/ramdisk/mysql | |
| ln -s /tmp/ramdisk/mysql/ /var/lib/mysql |
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
| PS1='\[\033[38m\]\u@\h\[\033[01;34m\] \w \[\033[31m\]`git branch 2>/dev/null | grep \* | head -1 | sed "s/\* //g" | awk "{ print \"(\"\\\$1 \")\" }"`\n\[\033[29m\]$\[\033[00m\] ' |