Skip to content

Instantly share code, notes, and snippets.

@spawnrider
spawnrider / fix_symlinks_fmk_ios.sh
Created July 26, 2013 11:52
This script recreate corrupted Symlinks into iOS Frameworks
@jkwiecien
jkwiecien / retrofit2_rxjava_proguard_config
Last active September 15, 2020 08:43
Retrofit2 + RxJava proguard config.
########--------Retrofit + RxJava--------#########
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-dontwarn sun.misc.Unsafe
-dontwarn com.octo.android.robospice.retrofit.RetrofitJackson**
-dontwarn retrofit.appengine.UrlFetchClient
-keepattributes Signature
-keepattributes Exceptions
-keepclasseswithmembers class * {
@retrofit.http.* <methods>;
@5agado
5agado / conway_2D.py
Created June 23, 2017 12:43
Code for reproducing a 2D Conway's Game of Life cellular automaton in Blender
import bpy
import sys
from mathutils import Vector
import numpy as np
class ConwayGOL_2D:
def __init__(self, N):
"""
2D Conway Game of Life
:param N: grid side size (resulting grid will be a NxN matrix)
@ashwinrayaprolu
ashwinrayaprolu / Install.md
Created April 20, 2019 06:40
OpenVINO Ubuntu Xenial, Virtualbox and Vagrant Install, Intel NCS2 (Neural Compute Stick 2)
import android.support.v7.widget.RecyclerView;
public class RecyclerViewSwipeListener extends RecyclerView.OnFlingListener {
private static final int SWIPE_VELOCITY_THRESHOLD = 2000;
boolean mIsScrollingVertically;
// change swipe listener depending on whether we are scanning items horizontally or vertically
RecyclerViewSwipeListener(boolean vertical) {
@martinwicke
martinwicke / automobile.ipynb
Last active January 9, 2022 08:14
Estimator demo using Automobile dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@laaptu
laaptu / DpToPxAndPxToDp
Last active February 14, 2022 21:06
Android convert dp to px and vice versa
public static float convertPixelsToDp(float px){
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
float dp = px / (metrics.densityDpi / 160f);
return Math.round(dp);
}
public static float convertDpToPixel(float dp){
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
float px = dp * (metrics.densityDpi / 160f);
return Math.round(px);
@patmaddox
patmaddox / 01_README.md
Created April 7, 2019 01:19
dorico custom instruments

To add custom instruments, you need to modify some XML files under /Applications/Dorico 2.app/Contents/Resources. Only do this if you're comfortable doing something like that!

For instruments.xml and instrumentnames_en.xml, you will add new entries. I placed them after the Pianoforte entry.

If your computer isn't set to English, choose the correct localization file for your system.

For instrumentFamiliesDefinitions.xml you will replace the existing keyboards entry (essentially you add instrument.keyboard.piano.alias.part to the `` element for Keyboards.

@cscalfani
cscalfani / ThinkAboutMonads.md
Last active December 4, 2022 20:58
How to think about monads

How to think about Monads

UPDATE 2021: I wrote this long before I wrote my book Functional Programming Made Easier: A Step-by-step Guide. For a much more in depth discussion on Monads see Chapter 18.

Initially, Monads are the biggest, scariest thing about Functional Programming and especially Haskell. I've used monads for quite some time now, but I didn't have a very good model for what they really are. I read Philip Wadler's paper Monads for functional programming and I still didnt quite see the pattern.

It wasn't until I read the blog post You Could Have Invented Monads! (And Maybe You Already Have.) that I started to see things more clearly.

This is a distillation of those works and most likely an oversimplification in an attempt to make things easier to understand. Nuance can come later. What we need when first le

@Fbalashov
Fbalashov / InvalidatesView.kt
Last active December 6, 2022 12:08
A property delegate to remove boilerplate when updating views
package *****
import android.view.View
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
/**
* Copyright 6/24/2017 Fuad Balashov
*
* Licensed under the Apache License, Version 2.0 (the "License");