// jQuery
$(document).ready(function() {
// code
})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CountingSorter implements Sorter { | |
private final int maxValue; | |
public CountingSorter(int maxValue) { | |
this.maxValue = maxValue; | |
} | |
@Override | |
public int[] sort(int[] values) { | |
int[] counts = new int[maxValue + 1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Bitmap; | |
/** | |
* Created by paveld on 3/6/14. | |
*/ | |
public class FastBlur { | |
public static Bitmap doBlur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap) { | |
// Stack Blur v1.0 from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.app.myapplication; | |
import android.content.Context; | |
import android.support.v4.widget.ViewDragHelper; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.view.ViewGroup; | |
public abstract class FlexScrollView extends ViewGroup { |
Centralize the support libraries dependencies in gradle
Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.
A very good way is to separate gradle build files, defining something like:
root
--gradleScript
----dependencies.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @summary Generates a testObjectBuilder example object | |
* @requires underscore, requirejs/commonjs | |
*/ | |
var testObjectBuilder = function(require) { | |
'use strict'; | |
var _ = require('underscore'), | |
OrderModel = require('./order_model'); |
- Code for generating the user_hash value for Intercom's Identity verfication (Note: Identity verification was prevoiusly called Secure Mode)
- Based on http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/#ruby
- When creating this for mobile, the final output needs to be in lowercase (the web version accepts both upper and lower case)
- So Javascript code below should only be used for testing unless modified and used to run on a server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_home) | |
setSupportActionBar(toolbar) | |
fab.setOnClickListener { | |
it.snack("Snack message") { | |
action("Action") { toast("Action clicked") } |
OlderNewer