Skip to content

Instantly share code, notes, and snippets.

View guiferrpereira's full-sized avatar
💻

Guilherme Pereira guiferrpereira

💻
View GitHub Profile
@guiferrpereira
guiferrpereira / README.md
Created June 17, 2021 09:22 — forked from MrCelticFox/README.md
An updated and improved auto-sell script for TownStar

Improved TownStar Auto-Sell Script

Disclaimer

At the time of writing scripts are allowed to be used with TownStar, as long as they don't do anything that breaks the game, but double check what the rules say to be sure: https://support.gala.games/town-star-rules

Use at your own risk, I have tested this and am satisfied it is free of bugs, but I am not responsible for any loss incurred by others that arose from using this script.

Now for the fun stuff...

 

@guiferrpereira
guiferrpereira / moment-js-timezones.txt
Created September 25, 2020 11:35 — forked from diogocapela/moment-js-timezones.txt
List of All Moment.js Timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@guiferrpereira
guiferrpereira / .gitlab-ci.yml
Created March 18, 2020 01:47 — forked from achmiral/.gitlab-ci.yml
Example Gitlab CI Config for a Rails + Nginx application using Docker Compose
# See how variables work, and a list of predefined ones:
# - https://docs.gitlab.com/ce/ci/variables/
variables:
RAILS_IMAGE: registry.gitlab.com/bryanbraun/gridmaster.io/railsapp:$CI_COMMIT_SHA
NGINX_IMAGE: registry.gitlab.com/bryanbraun/gridmaster.io/nginx:$CI_COMMIT_SHA
DEPLOY_TAG: $CI_COMMIT_SHA
cache:
paths:
- vendor/ruby
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
version: "3.3"
services:
sonarqube:
image: sonarqube:lts
deploy:
replicas: 1
labels:
- com.df.notify=true
- com.df.port=9000
- com.df.httpsOnly=false
{
"timers": [{
"dateDeleted": "",
"serverTime": "2018-01-18T15:38:05Z",
"intervals": [{
"to": "2018-01-18T15:06:07Z",
"from": "2018-01-18T15:06:01Z",
"id": "1008",
"duration": "6"
}, {
require 'benchmark/ips'
require 'redis'
class MethodProfiler
def self.patch(klass, methods, name)
patches = methods.map do |method_name|
<<~RUBY
unless defined?(#{method_name}__mp_unpatched)
alias_method :#{method_name}__mp_unpatched, :#{method_name}
def #{method_name}(*args, &blk)
unless prof = Thread.current[:_method_profiler]
require 'benchmark'
require 'action_view'
# include ActionView::Context
# include ActionView::Helpers::TextHelper
a = 'a'
b = 'b'
arr = %w(a b c d e f g h i)
Benchmark.bmbm(7) do |bm|
@guiferrpereira
guiferrpereira / gist:d6a7502298c8583b8faf41990bbe08ed
Last active October 20, 2017 10:57
NDrive Code Challenge
Please send a zip archive containing your code and any relevant materials in an email along with your resume and motivations to [email protected], please add [email protected] in CC.
The purpose of this test is not to see you're fast! Intead we want to verify your abilities to code and see how you architecture an application, so this is the time to show everything you know that is applicable and relevant (design pattern, OOP concepts, tests, etc.)
NDrive's quest for global domination has prompted us to open a store - we sell only three products:
```
+---------------|------------------------------|---------+
| Product Code | Name | Price |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib, urllib2
import traceback, time, random, datetime
from urlparse import urlparse, parse_qs
from urllib import urlencode
from os import getenv
import sys
from datetime import datetime