One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| AppBarLayout appBar = (AppBarLayout) rootView.findViewById(R.id.app_bar); | |
| appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { | |
| @Override | |
| public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { | |
| } | |
| }); |
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
| module ActiveRecord | |
| class Base | |
| class << self | |
| # | |
| # SELECT "payments".* | |
| # FROM "payments" | |
| # WHERE "payments"."id" = <id> | |
| # AND ("payments"."created_at" BETWEEN '<start month>' AND '<end month>') | |
| # ORDER BY "payments"."id" ASC LIMIT 1 | |
| # |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| require 'timeout' | |
| def a_method(iterations) | |
| Timeout::timeout(1) do # 1 second | |
| iterations.times { |i| print("#{i} "); sleep(0.1) } | |
| end | |
| rescue Timeout::Error | |
| print("TIMEOUT") | |
| ensure | |
| puts |
| module ActiveRecord::UnionScope | |
| def self.included(base) | |
| base.send :extend, ClassMethods | |
| end | |
| module ClassMethods | |
| def union_scope(*scopes) | |
| id_column = "#{table_name}.#{primary_key}" | |
| sub_query = scopes.map { |s| s.select(id_column).to_sql }.join(" UNION ") | |
| where "#{id_column} IN (#{sub_query})" |
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "os" | |
| ) | |
| var path = "/Users/novalagung/Documents/temp/test.txt" |
1609-09-12 19:02:35 PM +03:00 Sep Sat PDT
--------------- + ------------ + ------------
Type | Placeholder | Value
--------------- + ------------ + ------------
Year | 2006 | 1609
Year | 06 | 09
Month | 01 | 09
Month | 1 | 9
Month | Jan | Sep