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 "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
gem "rails" | |
gem "html5_validators" | |
gem "sqlite3" |
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
$ ls . | |
Dockerfile | |
$ cat Dockerfile | |
FROM ruby:2.5.1 | |
RUN bundle init | |
RUN echo "gem 'bundler_diffgems'" >> Gemfile | |
RUN bundle install --path vendor/bundle | |
CMD ["/bin/bash"] | |
$ docker build . |
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
from ruby:2.5.1 | |
RUn apt-get update -y && apt-get upgrade -y | |
RUN apt-get install graphviz groff-base -y | |
RUN apt-get install bsdmainutils -y | |
RUN git clone --depth 1 https://github.com/bundler/bundler | |
WORKDIR bundler | |
RUN ls -l | |
RUN bin/rake spec:deps |
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
source "https://rubygems.org" | |
# gem "rails" | |
gem 'coreaudio' |
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
<%= form_with(model: task, local: true) do |form| %> | |
<% if task.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(task.errors.count, "error") %> prohibited this task from being saved:</h2> | |
<ul> | |
<% task.errors.full_messages.each do |message| %> | |
<li><%= message %></li> | |
<% end %> | |
</ul> |
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
class BasicObject | |
def |(sym) | |
yield_self(&method(sym)) | |
end | |
end | |
module CountUp | |
attr_accessor :count | |
def initialize |
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
class A { | |
constructor(value) { | |
this.value = value | |
} | |
foo() { | |
const fun = function() { console.log('fun: ', this) } | |
fun(); | |
const bindFun = function() { console.log('bindFun: ', this) }.bind(this) |
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
// git clone https://github.com/rails/rails.git && cd rails && git checkout ee44c1b6f1ca3a8ee685807a940cf02101ed5141 && cd actionview && bundle && npm install && npm run build | |
// rails-ujs.js v5.1.4 mergd #30513, #29127 and #31002 | |
/* | |
Unobtrusive JavaScript | |
https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts | |
Released under the MIT license | |
*/ | |
(function() { | |
var context = this; |
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
// ==UserScript== | |
// @name Stop merging fixup! commit | |
// @version 0.2 | |
// @author ta1kt0me | |
// @match https://github.com/*/*/pull/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; |
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
function __what_command_execute() { | |
local cmd=$1 | |
export __NOTIFY_COMMAND="$cmd" | |
} | |
function __notify_complete_command() { | |
local cmd=$__NOTIFY_COMMAND | |
if [[ $cmd =~ "(be |bundle exec |bin/)rspec|(rails test)" ]] || | |
[[ $cmd =~ "(npm (test|install|run)|^mocha)" ]] || | |
[[ $cmd =~ "rails db:(migrate|reset|seed_fu)" ]]; then |