Skip to content

Instantly share code, notes, and snippets.

{
"set_attributes": {
"current_product_name": "Mặt Nạ Tinh Chất Vàng 24K - SIGNATURE PREMIUM GOLD AMPOULE MASK"
},
"messages": [
{
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
@ralphilius
ralphilius / custom.css
Created February 21, 2018 07:06
Pure CSS Ticker (Horizontal) by Lewis Carey https://codepen.io/lewismcarey/pen/GJZVoG
* {
box-sizing: border-box;
}
@-webkit-keyframes ticker {
0% {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
visibility: visible;
}
100% {
@ralphilius
ralphilius / config.txt
Last active April 5, 2016 04:48
Photoshop CC's Assets Generator for Android
default 100% mipmap-xxxhdpi/, 25% mipmap-mdpi/, 37.5% mipmap-hdpi/, 50% mipmap-xhdpi/, 75% mipmap-xxhdpi/
default 96px x 96px drawable-xxxhdpi/, 25% drawable-mdpi/, 37.5% drawable-hdpi/, 50% drawable-xhdpi/, 75% drawable-xxhdpi/
@ralphilius
ralphilius / TestFragment.java
Created November 24, 2015 10:00
Glide to load big image using BitmapRegionDecoder
public class TestFragment extends GlideRecyclerFragment {
protected RecyclerView listView;
@Override public @Nullable View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
RecyclerView view = new RecyclerView(container.getContext());
view.setId(android.R.id.list);
view.setLayoutParams(new MarginLayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
view.setLayoutManager(new LinearLayoutManager(container.getContext()));
return view;
}
@ralphilius
ralphilius / ScrollAwareFABBehavior.java
Last active November 1, 2015 02:31
Scroll-aware FloatingActionBar - FAB
/*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ralphilius
ralphilius / OriginalActivity.java
Created July 8, 2015 16:06
ImageView Transitions
View cardImage = (ImageView) findViewById(R.id.cardImage);
cardImage.setTransitionName("cardImage");
ImageView cardImage = (ImageView) findViewById(R.id.cardImage);
cardImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//This is where the magic happens. makeSceneTransitionAnimation takes a context, view, a name for the target view.
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(MaterialActivity.this, cardImage, "cardImage");
Intent intent = new Intent(OriginalActivity.this, DetailActivity.class);
# http://theoryapp.com/generate-slug-url-in-mysql/
#This checks text with special characters
SELECT * FROM schools WHERE
slug NOT RLIKE '^([a-z0-9]+\-)+[a-z0-9]+$';
#This updates special characters with dash
UPDATE reddit SET
title_slug = lower(title),
title_slug = replace(title_slug, '.', ' '),
title_slug = replace(title_slug, '\'', ''),