Skip to content

Instantly share code, notes, and snippets.

View Belkacem's full-sized avatar
🎯
Focusing

Belkacem REBBOUH Belkacem

🎯
Focusing
View GitHub Profile
@Belkacem
Belkacem / .gitlab-ci.yml
Created August 13, 2019 18:02 — forked from Mazuh/.gitlab-ci.yml
Example of gitlab CI/CD for a create-react-app application on Amazon S3 Bucket.
image: nikolaik/python-nodejs:latest
stages:
- install
- test
- deploy
prodInstall:
stage: install
script:
@Belkacem
Belkacem / cloudfront_usage.rb
Last active December 17, 2015 03:49
Cloudfront-1.2 gem usage
# Create a Cloudfront instance
cloudfront = Cloudfront.new('aws_access_key_id', 'aws_secret_access_key')
# Create a distribution
download_distribution = DownloadDistribution.new do
self.cnames.concat ["test.com", "test2.com"]
self.default_root_object = "/index.php"
self.origins.push Origin.new {
self.id = "test origin"
@Belkacem
Belkacem / string.rb
Last active December 16, 2015 23:49
import this in your library and your strings will be enriched with a to_bool method.
class String
def to_bool
return true if self == true || self =~ (/(vrai|v|oui|o|true|t|yes|y|1)$/i)
return false if self == false || self.empty? || self =~ (/(faux|non|false|f|no|n|0)$/i)
raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
end
end