I don't like Sprockets, but it's the easiest and best choice for lots of Ruby on Rails projects. When looking for a better way to manage my JavaScript assets and an improved developer story, my current tool of choice is webpack. While I wish Rails supported drop-in asset pipelines the way that Phoenix does, it's not hard to use webpack with Rails.
This file contains 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
git init . # cria um repositório | |
git remote origin https://github.com/usuario/projeto.git | |
# adiciona remote | |
# crie projeto no github antes | |
git add . # adiciona todos os arquivos | |
git commit -m 'mensagem' # faz o commit | |
git checkout -b gh-pages # cria branch gh-pages | |
git push origin gh-pages # envia para o github |
This file contains 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
public static int lighten(int color, double fraction) { | |
int red = Color.red(color); | |
int green = Color.green(color); | |
int blue = Color.blue(color); | |
red = lightenColor(red, fraction); | |
green = lightenColor(green, fraction); | |
blue = lightenColor(blue, fraction); | |
int alpha = Color.alpha(color); | |
return Color.argb(alpha, red, green, blue); | |
} |
This file contains 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
docker run -d -p 80:80 --name my-apache-php-app -v "$PWD":/var/www/html php:7.0-apache |
This file contains 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
<?php | |
/* | |
Nome: Adivinhe um Número | |
Autor: Turma P2-1 | |
Data: 19/08/2015 | |
*/ | |
function imprime_vitoria(){ | |
$class_vitoria = "warning"; |
This file contains 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
# Created by https://www.gitignore.io/api/android,osx,windows,linux,intellij,java | |
### Android ### | |
# Built application files | |
*.apk | |
*.ap_ | |
# Files for the Dalvik VM | |
*.dex |
This file contains 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
<?php | |
define("PERDEU", -1); | |
define("JOGANDO", 0); | |
define("GANHOU", 1); | |
define("MAX_CHUTES", 5); | |
define("MIN_SEGREDO", 1); | |
define("MAX_SEGREDO", 100); | |
This file contains 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
# Enter your code here. Read input from STDIN. Print output to STDOUT | |
class Queue | |
def initialize | |
@current_stack = [] | |
@aux_stack = [] | |
end | |
def enqueue(x) |
This file contains 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
=begin | |
Include in your rspec config like so: | |
RSpec.configure do |spec| | |
spec.include RSpec::RedisHelper, redis: true | |
end | |
This helper will clean redis around each example. | |
=end |
This file contains 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 ruby | |
# | |
# Passenger Process Monitor | |
# | |
# By Darren Oakley | |
# Based heavily on a script by James Smith (https://gist.github.com/851520) | |
# That in turn was based on a similar script by Jon Bettcher | |
# | |
# - Check memory usage of all paseenger child process and kill if grows too large. |