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
gem 'aws-sdk-cloudwatchlogs' |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
AllCops: | |
TargetRubyVersion: 2.2 | |
Exclude: | |
- db/schema.rb | |
# Relaxed.Ruby.Style | |
Style/Alias: | |
Enabled: false | |
StyleGuide: http://relaxed.ruby.style/#stylealias |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>My FB Reactions Page</title> | |
<style> | |
html { | |
box-sizing: border-box; | |
width: 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
hashtag = 'car' | |
url = "https://www.instagram.com/explore/tags/#{hashtag}/" | |
page = HTTParty.get(url) | |
body = Nokogiri::HTML.parse(page.body, nil, 'utf-8').text | |
reg = /display_src\": \"(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})\"}/ | |
images = body.scan(reg).map{|s| s[0] } | |
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: | |
elasticsearch: | |
image: elasticsearch:2.1.2 | |
ports: | |
- "9201:9200" | |
- "9301:9300" | |
volumes: | |
- "$PWD/esdata/plugins:/usr/share/elasticsearch/plugins" | |
- "$PWD/esdata:/usr/share/elasticsearch/data" |
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
function rgbToXyz(r, g, b) { | |
r /= 255 | |
g /= 255 | |
b /= 255 | |
if (r > 0.04045) r = Math.pow(((r + 0.055) / 1.055), 2.4) | |
else r = r / 12.92 | |
if (g > 0.04045) g = Math.pow(((g + 0.055) / 1.055), 2.4) | |
else g = g / 12.92 |
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
# Ways to execute a shell script in Ruby | |
# Example Script - Joseph Pecoraro | |
cmd = "echo 'hi'" # Sample string that can be used | |
# 1. Kernel#` - commonly called backticks - `cmd` | |
# This is like many other languages, including bash, PHP, and Perl | |
# Returns the result of the shell command | |
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111 |
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
gem 'capybara' | |
gem 'poltergeist' |
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
<script type="text/javascript" src="http://run26kimo.github.io/we-are-g0v/FileSaver.js"></script> | |
<script type="text/javascript" src="http://run26kimo.github.io/we-are-g0v/filer.min.js"></script> | |
<script type="text/javascript"> | |
function download(){ | |
blob = Util.dataURLToBlob(getBase64()); | |
saveAs(blob,'cover.png') | |
} | |
</script> |
NewerOlder