Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

if ( function_A() == OK )
{
if ( function_B() == OK )
{
/* Normal completion stuff */
}
else
{
/* some error recovery for Function_B */
}
for(j=0; j<array_len; j+ =8) {
total += array[j+0 ];
  total += array[j+1 ];
  total += array[j+2 ]; /* Main body of
  total += array[j+3 ]; * loop is unrolled
  total += array[j+4 ]; * for greater speed.
  total += array[j+5 ]; */
  total += array[j+6 ];
  total += array[j+7 ];
}
@akaita
akaita / windows-binding.json
Created March 1, 2019 11:28
Karabiner - PC-style for MacOs: Home, End and Undo
# ~/.config/karabiner/assets/complex_modifications/windows-binding.json
{
"title": "Windows keys",
"rules": [
{
"description": "swap control/command fix home/end/redo except for iterm2/vim",
"manipulators": [
{
"type": "basic",
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<meta-data android:name="com.bumptech.glide.integration.okhttp3.OkHttpGlideModule" tools:node="remove" />
</application>
@akaita
akaita / FavoriteToSendMorphView.kt
Created March 27, 2018 00:04
MorphView example
package com.akaita.android.morphview.example.kotlin
/**
* Created by mikel on 26/03/2018.
*/
import android.content.Context
import android.support.graphics.drawable.AnimatedVectorDrawableCompat
import android.util.AttributeSet
@akaita
akaita / HomeActivity.java
Created March 26, 2018 14:47
Using an AnimatedVectorDrawable (java)
public void onClickIcon() {
ImageView image = findViewById(R.id.someImageView);
((AnimatedVectorDrawable)image.getDrawable()).start()
}
@akaita
akaita / HomeActivity.kt
Last active March 26, 2018 14:48
Using an AnimatedVectorDrawable (kotlin)
fun onClickIcon() {
(someImageView.drawable as AnimatedVectorDrawable).start()
}
<vector>
<path
android:pathData="M 2 21 L 23 12 L 2 3 L 2 10 L 17 12 L 2 14 Z"/>
</vector>
<vector>
<path
android:pathData="M 1 10 L 1 12 L 1 21 L 10 21 L 17 21 L 1 10 Z"/>
</vector>
<vector>
<path
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
<vector>
<path
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>