def show
@activity = sandbox.activity.find(params[:id])
scope = self
class << @activity; self; end.send(:define_method,
:allowed_actions) do
%w[play pause finish delete reject approve accept
decline take_back].select do |action|
scope.can?(action.to_sym, self)
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
# Wifi | |
echo "deb http://http.debian.net/debian/ wheezy main contrib non-free" | sudo tee -a /etc/apt/sources.list | |
sudo apt-get update && sudo apt-get install firmware-iwlwifi | |
sudo modprobe -r iwlwifi ; sudo modprobe iwlwifi | |
# No crackling sound on reboot | |
echo "options snd-hda-intel single_cmd=1" | sudo tee -a /etc/modprobe.d/alsa-base.conf | |
# No beep on reboot | |
# in /etc/inputrc uncomment: |
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
# Gzip Settings | |
## | |
gzip on; | |
gzip_disable "msie6"; | |
# gzip_vary on; | |
# gzip_proxied any; | |
# gzip_comp_level 6; | |
# gzip_buffers 16 8k; | |
# gzip_http_version 1.1; | |
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; |
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
#!/usr/bin/env ruby | |
require 'open3' | |
begin | |
stdout, status = Open3.capture2("git status -uno --porcelain") | |
rescue Errno::ENOENT | |
abort "Cannot run `git status -uno --porcelain`." | |
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
def data(*args) | |
d = super | |
old_url = d.method(:url) | |
(class << d; self; end).send(:define_method, :url) do |*params| | |
File.join(OM::Application.config.om.root_url, old_url.call(*params)) | |
end | |
return d | |
end |
I hereby claim:
- I am JiriChara on github.
- I am jirichara (https://keybase.io/jirichara) on keybase.
- I have a public key whose fingerprint is A2F0 4A76 A379 5FD2 CD20 FA83 5BEC 1184 5A88 D248
To claim this, I am signing this object:
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 flatten(array) { | |
return array.reduce((acc, current) => { | |
// if current element is an array call flatten method recursively | |
if (Array.isArray(current)) { | |
return acc.concat(flatten(current)); | |
} | |
// otherwise just accumulate the current array | |
return acc.concat(current); | |
}, []); | |
}; |
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
<template> | |
<main class="container"> | |
<form @submit.prevent="onSubmit" class="form"> | |
<div class="title-wrapper"> | |
<h1 class="title">Log In</h1> | |
</div> | |
<b-notification | |
v-if="(!this.email || !this.password) && this.isDirty" | |
type="is-danger" | |
aria-close-label="Close notification" |
OlderNewer