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
/* | |
* Angular LoadScript | |
* | |
* Let angular load and execute lazy javascript from partials! | |
* | |
* This module is the result of this issue: "1.2.0rc1 regression: script tags not loaded via ngInclude" | |
* Issue url: https://github.com/angular/angular.js/issues/3756 | |
* | |
* As of Angular 1.2.0 the ngInclude scripts does not permit execution of javascript from included partials. | |
* This little module execute code inside script tags with "javascript-lazy" attribute after partial loading, |
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
/* | |
The MIT License (MIT) | |
Copyright (c) 2014 François de Campredon | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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; | |
import android.content.Intent; | |
import android.widget.Button; | |
import com.example.MockSupport; | |
import org.junit.Before; | |
import org.junit.Rule; | |
import org.junit.Test; |
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.content.Intent; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import org.hamcrest.Description; | |
import org.hamcrest.Matcher; | |
import org.hamcrest.TypeSafeMatcher; | |
import static android.support.test.InstrumentationRegistry.getInstrumentation; | |
import static org.hamcrest.MatcherAssert.assertThat; |
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 TilingDrawable extends android.support.v7.graphics.drawable.DrawableWrapper { | |
private boolean callbackEnabled = true; | |
public TilingDrawable(Drawable drawable) { | |
super(drawable); | |
} | |
@Override | |
public void draw(Canvas canvas) { |
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
/* GraphicGlDemoActivity.java | |
* Author: Yong Bakos | |
* Since: 11/26/2012 | |
* Thanks to: | |
* Cube: http://intransitione.com/blog/create-a-spinning-cube-with-opengl-es-and-android/ | |
* OpenGL Boilerplate: http://www.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/ | |
*/ | |
package com.humanoriented.sudoku; | |
import java.nio.ByteBuffer; |
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
module Main exposing (main) | |
import Html exposing (Html, text) | |
import Date | |
import Date.Extra as Date | |
main : Html msg | |
main = | |
Html.div [] |
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
func +(lhs: NSAttributedString, rhs: NSAttributedString) -> NSAttributedString { | |
let a = lhs.mutableCopy() as! NSMutableAttributedString | |
let b = rhs.mutableCopy() as! NSMutableAttributedString | |
a.appendAttributedString(b) | |
return a.copy() as! NSAttributedString | |
} |
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
// ... | |
Request request = new Request.Builder() | |
.url(url) | |
.tag(TAG) | |
.build(); | |
// Cancel previous call(s) if they are running or queued | |
OkHttpUtils.cancelCallWithTag(client, TAG); | |
// New call |
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
extension Dictionary { | |
public func map<T: Hashable, U>(@noescape transform: (Key, Value) -> (T, U)) -> [T: U] { | |
var result: [T: U] = [:] | |
for (key, value) in self { | |
let (transformedKey, transformedValue) = transform(key, value) | |
result[transformedKey] = transformedValue | |
} | |
return result | |
} | |