Skip to content

Instantly share code, notes, and snippets.

View tamagokun's full-sized avatar

Mike Kruk tamagokun

View GitHub Profile
@tamagokun
tamagokun / README.md
Created January 28, 2019 19:44
SCRIPT-8
require 'formula'
class FlexSdk < Formula
homepage "http://www.adobe.com/devnet/flex.html"
url "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip"
sha256 "622b63f29de44600ff8d4231174a70fcb3085812c0e146a42e91877ca8b46798"
def install
Dir['*'].each { |file| cp_r file, File.join( prefix, File.basename(file) ) }
@tamagokun
tamagokun / swap.sh
Created August 9, 2016 13:12
Create a swap file on Amazon EC2
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
sudo chmod 600 /var/swap.1
# Add to /etc/fstab
/var/swap.1 swap swap defaults 0 0
@tamagokun
tamagokun / install_docker_compose.sh
Last active May 30, 2016 16:43
Install docker and docker compose on Ubuntu
wget -qO- https://get.docker.com/ | sh
sudo usermod -aG docker ubuntu
sudo apt-get install python-pip
sudo pip install docker-compose
@tamagokun
tamagokun / interactor.js
Created November 23, 2015 15:34
Interactor in node.js
import co from 'co'
export default (...funcs) => {
return (context = {}) => {
return co(function*() {
// set up our result context
let result = {
...context,
fail(msg = 'Failed') {
  • access to panel (Yes/No)
    • admin access (Yes/No) (skip rest when Yes)
    • access Content section (Yes/No)
      • manage Collections (Yes/No) (skip rest when Yes)
        • CRUD {collection}
        • CRUD all collections
      • manage Content Types (Yes/No) (skip rest when Yes)
        • CRUD {content type}
        • CRUD all content
  • access Settings section (Yes/No)
@tamagokun
tamagokun / tmux-truecolor.rb
Last active August 29, 2015 14:22
Homebrew formula for tmux patched with true color support
require 'formula'
class Tmux < Formula
homepage 'http://tmux.sourceforge.net'
url 'https://downloads.sourceforge.net/project/tmux/tmux/tmux-2.0/tmux-2.0.tar.gz'
sha1 '977871e7433fe054928d86477382bd5f6794dc3d'
bottle do
cellar :any
sha256 "91a14274005416c9a20f64f149f732837b0503c0ddcfdc80f87c0576e99ee3fa" => :yosemite
@tamagokun
tamagokun / slides.js
Created February 24, 2015 15:01
dave's slides
var interList;
var runSlides = function() {
interList = setInterval(function() {
$(".jcarousel li").fadeOut(1000).hide();
$(".jcarousel li.front").removeClass("front").next().fadeIn(1000).addClass("front");
$(".jcarousel li:first").appendTo(".jcarousel ul");
}, 5000);
}
$(document).ready(function() {
module.exports = class ExampleView extends View
bindings:
'[name=sub_field]':
observe: 'field'
onSet: (val) ->
@setSubField 'sub_field', val
onGet: (val) ->
@getSubField 'sub_field', val
setSubField: (key, val) ->