This file contains hidden or 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
(ns advent-of-code.day-1) | |
(def data | |
(let [xf (map (fn [x] [(if (= (first x) \R) 1 -1) | |
(Integer/parseInt (apply str (rest x)))]))] | |
(as-> (slurp "resources/aoc-d1-input") $ | |
(clojure.string/split $ #"[, \n]+") | |
(into [] xf $)))) | |
(def locations (atom #{})) |
This file contains hidden or 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
(def triangles [566 477 376 575 488 365 50 18 156 558 673 498 133 112 510 670 613 25 84 197 643 910 265 611 894 252 545 581 3 598 98 742 574 628 746 193 129 677 265 187 445 169 288 242 128 569 744 439 685 748 471 256 23 157 218 343 491 777 905 633 778 867 840 672 772 947 500 763 420 449 665 653 23 558 858 745 407 904 766 194 576 11 541 423 179 690 274 174 747 279 741 538 336 507 698 667 689 920 467 405 861 35 575 631 992 317 573 981 817 536 44 816 205 653 45 631 683 509 300 418 712 192 865 666 133 859 32 331 54 572 432 259 552 456 267 766 931 643 902 840 557 465 318 175 491 863 329 463 795 564 589 213 805 340 323 123 602 812 499 898 931 555 899 835 341 316 487 789 677 790 797 341 502 123 502 196 136 702 617 82 939 581 362 801 834 951 464 941 843 7 756 971 273 297 661 270 620 387 776 96 80 891 125 92 376 175 141 435 247 949 719 586 478 578 662 801 446 202 |
This file contains hidden or 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
(def triangles [566 477 376 575 488 365 50 18 156 558 673 498 133 112 510 670 613 25 84 197 643 910 265 611 894 252 545 581 3 598 98 742 574 628 746 193 129 677 265 187 445 169 288 242 128 569 744 439 685 748 471 256 23 157 218 343 491 777 905 633 778 867 840 672 772 947 500 763 420 449 665 653 23 558 858 745 407 904 766 194 576 11 541 423 179 690 274 174 747 279 741 538 336 507 698 667 689 920 467 405 861 35 575 631 992 317 573 981 817 536 44 816 205 653 45 631 683 509 300 418 712 192 865 666 133 859 32 331 54 572 432 259 552 456 267 766 931 643 902 840 557 465 318 175 491 863 329 463 795 564 589 213 805 340 323 123 602 812 499 898 931 555 899 835 341 316 487 789 677 790 797 341 502 123 502 196 136 702 617 82 939 581 362 801 834 951 464 941 843 7 756 971 273 297 661 270 620 387 776 96 80 891 125 92 376 175 141 435 247 949 719 586 478 578 662 801 446 202 |
This file contains hidden or 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
cache: | |
paths: | |
- app/version.properties | |
before_script: | |
- export ANDROID_HOME=/opt/android | |
- touch app/version.properties | |
- ./gradlew clean | |
build: |
This file contains hidden or 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
var state: MutableMap<String, Any?> = HashMap() | |
private var foo: Int by state | |
private var bar: String by state | |
override fun onSaveInstanceState(): Parcelable { | |
// ... | |
This file contains hidden or 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 BetterRecyclerView extends RecyclerView{ | |
private static final int INVALID_POINTER = -1; | |
private int mScrollPointerId = INVALID_POINTER; | |
private int mInitialTouchX, mInitialTouchY; | |
private int mTouchSlop; | |
public BetterRecyclerView(Context context) { | |
this(context, null); | |
} | |
public BetterRecyclerView(Context context, @Nullable AttributeSet attrs) { |
This file contains hidden or 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
#!/usr/bin/ruby | |
require 'redcarpet' | |
class RayParser < Redcarpet::Render::HTML | |
# *important concept* | |
def emphasis(text) | |
"<i>#{text}</i>" | |
end |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>SVG SMIL Animate with Path</title> | |
</head> | |
<body> | |
<svg width="300px" height="100px"> | |
<rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> | |
<rect x="0" y="0" width="20" height="20" fill="blue" stroke="black" stroke-width="1"> | |
<animateMotion path="M 250,80 H 50 Q 30,80 30,50 Q 30,20 50,20 H 250 Q 280,20,280,50 Q 280,80,250,80Z" |
This file contains hidden or 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
(ns clj-spec-playground | |
(:require [clojure.string :as str] | |
[clojure.spec :as s] | |
[clojure.test.check.generators :as gen])) | |
;;; examples of clojure.spec being used like a gradual/dependently typed system. | |
(defn make-user | |
"Create a map of inputs after splitting name." | |
([name email] |
This file contains hidden or 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 BadgeUtils { | |
public static void setBadge(Context context, int count) { | |
setBadgeSamsung(context, count); | |
setBadgeSony(context, count); | |
} | |
public static void clearBadge(Context context) { | |
setBadgeSamsung(context, 0); |