Skip to content

Instantly share code, notes, and snippets.

View putraxor's full-sized avatar
💭
I may be slow to respond.

Ardiansyah Putra putraxor

💭
I may be slow to respond.
View GitHub Profile
@esafirm
esafirm / DenomSuggestion.kt
Last active July 30, 2017 03:35
Given some amount, return possible values that constructed by particular denomination
val denom = arrayOf(1, 2, 5, 10, 20, 50, 100)
val amount = arrayOf(5, 11, 53, 122, 155, 157, 210, 200)
fun main(args: Array<String>) = amount.forEach { currentAmount ->
val suggestions = mutableListOf<Int>()
denom.forEach {
if (it >= currentAmount) {
suggestions += it
@chinmaygarde
chinmaygarde / Desktop.md
Created February 2, 2016 19:45
Flutter Desktop Runner
  • You need to build the engine from source. Follow the steps at https://github.com/flutter/engine/blob/master/CONTRIBUTING.md#getting-the-code-and-configuring-your-environment
    • You can skip the forking step if you don’t think you will be contributing changes to the engine.
  • Once your environment is setup, build the engine in Release mode.
    • $ sky/tools/gn —release
    • $ ninja -C out/Release -j12
  • After the long build you will find a Mac application called SkyShell.app in out/Release. This is the generic Flutter application runner. It does not know anything about your dart project yet.
  • Create a sample dart project
    • $ flutter init -o mac_hello
  • From the command line, launch the SkyShell.app with command line flags telling it where your dart project resides and its package root. On my system I did this:
  • $ ./out/Release/SkyShell.app/Contents/MacOS/SkyShell PATH_TO_PROJECT/lib/main.dart --package-root=PATH_TO_PROJECT/packages
@AlexBlokh
AlexBlokh / RatioViewPager.java
Last active March 31, 2017 11:36
ViewPager with custom aspect ratio
public class RatioViewPager extends ViewPager {
private float mRatio = 1f;
public RatioViewPager(Context context) {
super(context);
}
public RatioViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
@sixtenbe
sixtenbe / analytic_wfm.py
Last active February 14, 2025 21:52 — forked from endolith/peakdet.m
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See