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
FROM ruby:3.0.1 | |
ARG USER_ID | |
ARG GROUP_ID | |
RUN addgroup --gid $GROUP_ID user | |
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user | |
RUN apt-get update -qq |
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
FROM ruby:3.0.1 | |
ARG USER_ID | |
ARG GROUP_ID | |
RUN addgroup --gid $GROUP_ID user | |
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user | |
RUN apt-get update -qq |
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
<? echo "Hello World" ?> |
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
version: '2' | |
services: | |
web: | |
build: . | |
links: | |
- redis | |
- webpack | |
ports: | |
- 2400:2400 | |
volumes: |
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
//Add this to fetch the SCALINGO_MYSQL_URL | |
$url = parse_url(getenv("SCALINGO_MYSQL_URL")); | |
$db['default'] = array( | |
'dsn' => '', | |
'hostname' => $url["host"], | |
'username' => $url["user"], | |
'password' => $url["pass"], | |
'database' => substr($url["path"], 1), | |
'dbdriver' => 'mysqli', |
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
DATABASE_URL=mysql2://dbuser:[email protected]/dbuser | |
DATABASE_URL_TEST=mysql2://dbuser:[email protected]/dbuser | |
DEFAULT_HOST=localhost:3000 |
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
require "sinatra" | |
get '/' do | |
html = "" | |
filenames = Dir.glob("articles/*.txt").sort.reverse | |
filenames.each{|filename| | |
html += article_as_html(filename, 100) | |
} | |
return layout(html) | |
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
require "sinatra" | |
get '/' do | |
html = "" | |
filenames = Dir.glob("articles/*.txt").sort.reverse | |
filenames.each{|filename| | |
html += article_as_html(filename, 100) | |
} | |
return layout(html) | |
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
require "sinatra" | |
get '/' do | |
html = '<html><head><title>Mon blog</title><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"></head><body>' | |
html += '<div class="container"><div class="row"><div class="col-12">' | |
# récupération de la liste des noms de fichiers, triée par ordre alphabétique inverse | |
filenames = Dir.glob("articles/*.txt").sort.reverse | |
filenames.each{|filename| | |
# on lit le contenu du fichier |
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
func LastMinutesTweets() ([]InfluxValue, error) { | |
queryString := "SELECT SUM('value') FROM 'tweets'" | |
queryString += " WHERE hashtag = '" + config.E["HASHTAG"] + "'" | |
queryString += " AND time >= now() - 60m" | |
queryString += " GROUP BY time(1m) fill(none) ORDER BY time DESC LIMIT 60" | |
return executeQuery(queryString) | |
} | |
func executeQuery(queryString string) ([]InfluxValue, error) { |
NewerOlder