Skip to content

Instantly share code, notes, and snippets.

View hibariya's full-sized avatar

Hibariya hibariya

View GitHub Profile
import Ember from 'ember';
window.list = null;
export default Ember.Controller.extend({
appName:'Ember Twiddle',
list: [Ember.Object.create({name: 'alpha'}), Ember.Object.create({name: 'bravo'}), Ember.Object.create({name: 'charlie'})],
cmp: Ember.computed('list.@each.name', function() {
@hibariya
hibariya / application.controller.js
Last active January 10, 2016 05:17
Container returns falsy value as undefined on 2nd or later lookup
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
inspectLookup() {
return Ember.inspect(this.container.lookup('falsy:false'));
},
firstLookup: Ember.computed(function() {
return `1st lookup: ${this.inspectLookup()}`;

Borrow and AsRef

Rust of Us - Chapter 3

Borrow and AsRef について調べたことをまとめた資料です。一部のコードは参照している文書から引用しています。

Borrow と AsRef は似ている

API Doc の Examples を見ても差分がよく分からない。

@hibariya
hibariya / break_terminal.c
Created June 25, 2015 15:02
Update self termios and break the terminal.
#include <unistd.h>
#include <termios.h>
int
main() {
struct termios orig_termios;
tcgetattr(STDIN_FILENO, &orig_termios);
orig_termios.c_oflag &= ~(OPOST);
@hibariya
hibariya / metacity-theme-3.xml
Created May 19, 2015 03:15
~/.local/share/themes/Adwaita/metacity-1
<?xml version="1.0"?>
<metacity_theme>
<info>
<name>Adwaita</name>
<author>GNOME Art Team &lt;art.gnome.org&gt;</author>
<copyright>&#194; Intel, &#194; Red Hat, Lapo Calamandrei</copyright>
<date>2012</date>
<description>Default GNOME 3 window theme</description>
</info>
@hibariya
hibariya / gist:7623686
Created November 24, 2013 05:23
ひとつの入力を複数のシェルで実行する
#!/usr/bin/env ruby
require 'curses'
require 'pty'
require 'landescape'
class Terminal < Struct.new(:window, :stdout, :stdin, :pid)
def wait
Process.detach(pid).join
end
@hibariya
hibariya / gist:7040873
Last active December 25, 2015 21:09
子プロセスの入力を制御しつつ出力をいただきたい。 ruby から起動した bash の中で vim をつかいたいときはこんなかんじでいいの?
#!/usr/bin/env ruby
require 'pty'
require 'curses'
PTY.getpty 'bash' do |stdout, stdin, pid|
# 画面のサイズを変えてみる
stdin.puts 'stty rows 10'
stdin.puts 'stty cols 50'
fatal: '/home/git/repositories/hibariya_retter.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
@hibariya
hibariya / gist:3129732
Created July 17, 2012 14:30
null@jp.rubyist.net に送れなかったらしくて
This is an automatically generated Delivery Status Notification
THIS IS A WARNING MESSAGE ONLY.
YOU DO NOT NEED TO RESEND YOUR MESSAGE.
Delivery to the following recipient has been delayed:
null@jp.rubyist.net
@hibariya
hibariya / md-syntax.md
Created April 23, 2012 04:37
md-syntax