Skip to content

Instantly share code, notes, and snippets.

View index.html.haml
%h1 Listing invoices
%table
%tr
%th Amount
%th Info
- for invoice in @invoices
%tr
%td= invoice.amount
@morhekil
morhekil / app_data.rb
Created September 12, 2012 11:54 — forked from railyboy/app_data.rb
Loading .yml configuration data with the code from http://speakmy.name/2011/05/29/simple-configuration-for-ruby-apps
View app_data.rb
module AppData
#require 'deep_symbolizable'
# again - it's a singleton, thus implemented as a self-extended module
extend self
@_settings = {}
attr_reader :_settings
View thred_hang.rb
t = Thread.new do
pid = fork do
raise 'hello'
end
Process.waitpid(pid)
end
t.join
View gist:975d1ff83ec1bde103bc
# Substitute path/version of hadoop files below
HADOOP_CLASSPATH=/usr/local/Cellar/hadoop/2.4.0/libexec/share/hadoop/yarn/test/hadoop-yarn-server-tests-2.4.0-tests.jar hadoop jar /usr/local/Cellar/hadoop/2.4.0/libexec/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.4.0-tests.jar minicluster --nnport=8020
View rails-json-schema-validation.md

Validate JSON schema in Rails

Topics

  1. What/Why JSON schema
  2. Apply to rails model validation
  3. Test your API endpoint with schema matcher
  4. Homework for a curious reader
  5. References
View building-a-graphql-api-in-rails-part-1.md

Building a GraphQL API in Rails - Part 1

This is a series blog post cover above three topics of GraphQL:

  1. About GraphQL
  2. Building a basic API with Rails
  3. Some best practices

GraphQL has been around for a while already, and it is not a new thing. The reason I decided to investigate it is because Github have recently released their GraphQL API alpha. Github has been on a forefront of API-driven development for quite some time now, and their RESTful API is an exemplary API design used as a reference by many developers - so it's pretty interesting to see what's new they have released.

@morhekil
morhekil / ios-how-to-communicate-with-iframes.md
Last active January 24, 2018 14:58 — forked from wayne5540/ios-how-to-communicate-with-iframes.md
This article is to show how to inject JavaScript into iframs under iOS web view and so we can communicate with it.
View ios-how-to-communicate-with-iframes.md

[iOS - Swift] How to communicate with iFrames inside WebView

One of the core technologies at the heart of Onefill is its ability to auto-fill even the most complex form on a website with 100% precision, with a single tap. And the techology that built does allow us to do just that, but with one exception - iframes.

And while you might think that iframes are a thing of the past (who would use them these days, right?) - the reality is that they're often powering some of the most critical piece of functionality there is on online store - its payment

View gist:95403e0fd1660443ed6d8d93ae3c09ca

Node.js Workshop

Prework:

  • Install node
  • Download repo and get it running
  • Sign up for trial account for lambda service

Day 1

@morhekil
morhekil / config
Created March 15, 2022 10:36 — forked from ltk/config
Split Test Load Balancer Nginx Configuration
View config
map $split_test_cookie_name $split_test_cookie {
default $cookie_split_test_version;
}
upstream app.com {
server old.app.com;
}
split_clients "app${remote_addr}${http_user_agent}${date_gmt}" $upstream_variant {
10% "test";