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
| require 'uri' | |
| require 'open3' | |
| namespace :scalingo do | |
| namespace :mysql do | |
| desc "Backup Scalingo MySQL database" | |
| task backup: :environment do | |
| app = ENV["APP"] | |
| variable = ENV["DB_ENV_NAME"] || "SCALINGO_MYSQL_URL" | |
| database, user, password = find_credentials_url(app, variable) |
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
| <html> | |
| <head> | |
| <link href='https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,400italic,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'> | |
| </head> | |
| <body> | |
| <div style="display:block;width:500px;height:50px;border:#8bc34a solid 2px;background:linear-gradient(to right, #8bc34a 0%,#8bc34a 71%,white 71.1%,white 100%);position:fixed;top:100px;left:200px;"> | |
| <div style="display:block;width:2px;height:10px;background-color:8bc34a;position:absolute;top:-12px;left:70.5%;"> | |
| <div style="display:block;position:absolute;top:-16px;left:-18px;font-size:10px;font-family: 'Roboto';font-weight:300;"> | |
| 2mn30s | |
| </div> |
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
| <html> | |
| <head> | |
| <link href='https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,400italic,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'> | |
| </head> | |
| <body> | |
| <img src="https://wekan.io/static/wekan-logo.png" style="height:30px;position:fixed;top:112px;left:15px;" /> | |
| <div style="display:block;width:500px;height:50px;border:#8bc34a solid 2px;position:fixed;top:100px;left:140px;"> | |
| <div style="display:block;position:absolute;top:0;bottom:0;left:0;right:0;background:repeating-linear-gradient(135deg,#ccc,#ccc 10px,white 10px,white 20px);opacity:0.3;"> | |
| </div> |
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
| <html> | |
| <head> | |
| <title>Mon blog</title> | |
| </head> | |
| <body> | |
| <% @articles.each{|article| %> | |
| <h1><%= article[:title] %></h1> | |
| <p><%= article[:body] %></p> | |
| <a href='<%= article[:link] %>'> | |
| Voir détails |
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
| require 'rubygems' | |
| require 'aws-sdk' | |
| access_key_id = ENV['AWS_ACCESS_KEY_ID'] | |
| secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] | |
| bucket = ENV['FOG_DIRECTORY'] | |
| region = ENV['FOG_REGION'] | |
| s3 = Aws::S3::Client.new( | |
| region: region, |
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
| 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) { |
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
| 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 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
| 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 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
| 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 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
| DATABASE_URL=mysql2://dbuser:secret@127.0.0.1/dbuser | |
| DATABASE_URL_TEST=mysql2://dbuser:secret@127.0.0.1/dbuser | |
| DEFAULT_HOST=localhost:3000 |