Skip to content

Instantly share code, notes, and snippets.

Alex Lockwood alexjlockwood

Block or report user

Report or block alexjlockwood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alexjlockwood
alexjlockwood / avdwtf.xml
Created Nov 14, 2018
This AVD works...???!?
View avdwtf.xml
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
android:height="300dp"
android:width="300dp"
android:viewportHeight="24"
android:viewportWidth="24">
<clip-path android:name="clip" android:pathData="M 12 12 h 0 v 0 h 0 v 0 z">
View animation.json
{"v":"5.2.1","fr":60,"ip":0,"op":66,"w":1000,"h":1000,"nm":"Lyft_AmpPaired_Streak_003","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 4","parent":10,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[1000,1000],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.482352942228,0.1254902035,0.976470589638,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":66,"
@alexjlockwood
alexjlockwood / svgo.json
Last active Oct 30, 2019
A customized SVGO (github.com/svg/svgo) config for use with the Sketch SVGO Compressor plugin (github.com/BohemianCoding/svgo-compressor).
View svgo.json
{
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": true,
"indent": 2,
"floatPrecision": 3,
"plugins": [
{
"name": "removeDoctype",
"enabled": true
},
View alex-svgo-sketch-plugin-settings.json
{
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": true,
"indent": 2,
"floatPrecision": 3,
"plugins": [
{
"name": "removeDoctype",
"enabled": true
},
View asdf.txt
Angular2 Http Example
---------------------
This is a sample application based on off Angular2 to show the use of http in an application.
In this example, we are using https://developer.nutritionix.com/for nutrition information; showing how to access REST API using ngFor directive for rendering the data.
A [Pen](http://codepen.io/aaronksaunders/pen/EKRJRJ) by [aaron k saunders](http://codepen.io/aaronksaunders) on [CodePen](http://codepen.io/).
[License](http://codepen.io/aaronksaunders/pen/EKRJRJ/license).
View heartbreak.shapeshifter
{
"version": 1,
"layers": {
"vectorLayer": {
"id": "93",
"name": "heartbreak",
"type": "vector",
"width": 56,
"height": 56,
"alpha": 1,
@alexjlockwood
alexjlockwood / demo.png
Last active May 6, 2018
Clip paths in VectorDrawable vs. SVG. The `svg_demo.svg` and `vector_drawable_demo.xml` files both have the appearance shown in `demo.png`. As you can see from each file's content, the syntax for expressing clip paths in SVGs vs. VectorDrawables is much different. View the commit that inspired this gist here: https://j.mp/2JYio7I.
@alexjlockwood
alexjlockwood / heartbreak-after-91kb.svg
Last active May 4, 2018
SVG sprite sheet 60fps exports of Shape Shifter demos (before vs. after optimizations). On average 44% file size reduction.
View heartbreak-after-91kb.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexjlockwood
alexjlockwood / PolygonsFragment.java
Last active Apr 14, 2018
An alternative polygon animation for the Kyrie sample app. See also j.mp/PolygonsFragment and the Twitter discussion here: https://twitter.com/alexjlockwood/status/985049112495222785
View PolygonsFragment.java
package com.example.kyrie;
import android.graphics.Color;
import android.graphics.PointF;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
@alexjlockwood
alexjlockwood / suntomoon.shapeshifter
Created Apr 12, 2018
A sun-to-moon path morphing animation. Inspired by Mark Allison's Chicago Roboto talk. Open in https://shapeshifter.design ("File" --> "Open" --> "suntomoon.shapeshifter")
View suntomoon.shapeshifter
{
"version": 1,
"layers": {
"vectorLayer": {
"id": "221",
"name": "vector",
"type": "vector",
"width": 1000,
"height": 1000,
"children": [
You can’t perform that action at this time.