Skip to content

Instantly share code, notes, and snippets.

View ruz's full-sized avatar

Ruslan Zakirov ruz

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@ruz
ruz / nginx.conf
Last active December 23, 2015 16:09
server {
listen 80;
server_name example.com;
proxy_cache one;
proxy_cache_lock on;
proxy_cache_valid 1m;
location /a/ {
proxy_pass http://127.0.0.1:5000;
}
location /b/ {
proxy_cache_path /var/nginx/cache/site_cache levels=1:2 keys_zone=site:256m max_size=4096m inactive=10m;
location {
proxy_cache_use_stale updating timeout http_500 http_502 http_504;
proxy_cache site;
proxy_cache_lock on;
proxy_cache_key $common_cache_key;
proxy_cache_valid 1m;
proxy_cache_lock_timeout 60s;
ssi on;
@ruz
ruz / application.controller.js
Created December 3, 2015 17:25
action helper as value of onxxx attribute
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
test() {
console.log(arguments);
}
}
});
@ruz
ruz / application.controller.js
Last active October 12, 2017 02:35
key press action has no access to event
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
keyUp() { console.log( "ku:", arguments) },
keyPress() { console.log( "kp:", arguments) }
}
});
@ruz
ruz / application.controller.js
Last active December 12, 2015 07:52
prevent form submit on enter key
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
prevent(e) {
console.log("here we are");
e.preventDefault();
return false;
},
@ruz
ruz / application.controller.js
Created November 30, 2015 17:48
ember if helper in attributes
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
use v5.10;
use strict;
use warnings;
use Marpa::R2;
my $syntax = <<'END';
:default ::= action => ::first
:start ::= content
content ::= name ':' value
@ruz
ruz / output.txt
Created January 6, 2014 21:46
Problem with marpa's scanless interface
rules L0:
G0 R0 'BEGIN:VCARD' ::= [B] [E] [G] [I] [N] [\:] [V] [C] [A] [R] [D]
G0 R1 'VERSION:4.0' ::= [V] [E] [R] [S] [I] [O] [N] [\:] [4] [\.] [0]
G0 R2 'END:VCARD' ::= [E] [N] [D] [\:] [V] [C] [A] [R] [D]
G0 R3 ':' ::= [\:]
G0 R4 '.' ::= [\.]
G0 R5 group ::= A_D_D
G0 R6 name ::= A_D_D
G0 R7 ';' ::= [\;]
G0 R8 '=' ::= [\=]
@ruz
ruz / new_gist_file_0
Created December 3, 2013 12:56
check
<script>
jQuery(document).ready(function($) {
(function(Registry) {
$.Sports.Registry
.set('tag_id', '1044511')
})(jQuery.Sports.Registry);
});
</script>