#
# install daemon preconditions
#
include_recipe "apt"
mysql_root_password = "change me"
mysql_port = "3306"
wordpress_db = "wordpressdb"
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
class MyJob < ActiveJob::Base | |
queue_as :urgent | |
rescue_from(NoResultsError) do | |
retry_job wait: 5.minutes, queue: :default | |
end | |
def perform(*args) | |
MyService.call(*args) | |
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 'github_api' | |
github = Github.new | |
dir = github.repos.contents.get :user => 's2t2', :repo => 'text', :path => '/' | |
files = dir.map{|f| | |
github.repos.contents.get :user => 's2t2', :repo => 'text', :path => f.path.to_s | |
} |
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 'capybara/poltergeist' | |
require 'ruby-progressbar' | |
session = Capybara::Session.new(:poltergeist) | |
session.visit("https://bank.simple.com/signin") | |
session.fill_in("username", with: "USERNAME") | |
session.fill_in("password", with: "PASSWORD") | |
session.click_on("Sign in") |
Liquid Fill Gauge v1.1 - 7/14/2015
Changes:
- Added support for updating the gauge value after loading is complete. The loadLiquidFillGauge method now returns an object with an update method which allows the gauge value to be changed. Click any of the gauges above to randomly update their value.
Configurable features include:
- Changeable min/max values.
- All colors.
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
import code; code.interact(local=dict(globals(), **locals())) |
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
/* count of issues opened, closed, and reopened on 2019/01/01 */ | |
SELECT event as issue_status, COUNT(*) as cnt FROM ( | |
SELECT type, repo.name, actor.login, | |
JSON_EXTRACT(payload, '$.action') as event, | |
FROM `githubarchive.day.20190101` | |
WHERE type = 'IssuesEvent' | |
) | |
GROUP by issue_status; |
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> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
background: #222; | |
color:#fff; | |
font-family: "Helvetica Neue", Helvetica, sans-serif; |
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
/** | |
* Page layout, reused across multiple Page components | |
* @jsx React.DOM | |
*/ | |
var React = require('react'); | |
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment'); | |
var Navigation = require('../components/Navigation.jsx'); | |
var DefaultLayout = React.createClass({ |
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
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |