Skip to content

Instantly share code, notes, and snippets.

View anop72's full-sized avatar
🎯
Focusing

champ.ak anop72

🎯
Focusing
View GitHub Profile
@anop72
anop72 / gist:8fff5f3ffd1dec91f3e9609c6c133af3
Created August 6, 2018 05:07
fuel-kotlin-refresh-token-test
private fun getData(): Single<String> {
var request: Request? = null
var response: Response? = null
var data: Any? = null
var error: FuelError? = null
var manager = FuelManager()
manager.basePath = "http://192.168.1.73:3000"
@anop72
anop72 / introrx.md
Created November 1, 2016 09:07 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@anop72
anop72 / curl
Last active October 2, 2016 07:25
fb_message_api
curl -X POST "https://graph.facebook.com/v2.7/me/subscribed_apps?access_token=PAGE_APP_TOKEN"
curl -X POST -H "Content-Type: application/json" -d '{
"setting_type":"greeting",
"greeting":{
"text":"greeting message"
}
}' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=PAGE_APP_TOKEN"
@anop72
anop72 / rxjs_operators_by_example.md
Created September 29, 2016 07:56 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
@anop72
anop72 / seo.service.ts
Last active October 11, 2016 23:19 — forked from LA1CH3/seo.service.ts
set meta tag on angular 2 single page application
/*
SEO Service for Updating Title, Meta Tags, Etc.
*/
import { Injectable } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { getDOM } from '@angular/platform-browser/src/dom/dom_adapter';
@Injectable()
@anop72
anop72 / nginx.conf
Last active May 6, 2019 05:59
nginx use cookie as cache key
# guide https://www.nginx.com/blog/nginx-caching-guide/
# document for variable http://nginx.org/en/docs/http/ngx_http_core_module.html#Variables
server {
...
location / {
# point is cookie name shouldn't contain - (hyphen), it cause wrong hash key.
# example $cookie_gist_var
proxy_cache_key $proxy_host$request_uri$cookie_{cookieNameShouldNotContainHyphen};
...
}
@anop72
anop72 / data.java
Last active August 29, 2015 14:25
Android Ecommerce Tracking
Map<String, String> transaction = new HitBuilders.TransactionBuilder()
.setTransactionId(ads.getItemId())
.setAffiliation(memberModel.getmember_id())
.setRevenue(Double.parseDouble(ads.getPrice()))
.setTax(0)
.setShipping(0)
.setCurrencyCode("")
.build();
Map<String, String> item = new HitBuilders.ItemBuilder()
private static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override