Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ButtonWithImage.MainPage"
Title="Button Image Sample"
BackgroundColor="White">
<ContentPage.Resources>
<ResourceDictionary>
<OnPlatform x:Key="RefreshImage" x:TypeArguments="ImageSource">
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ButtonWithImage.MainPage"
Title="Button Image Sample"
BackgroundColor="White">
<ContentPage.Resources>
<ResourceDictionary>
<OnPlatform x:Key="RefreshImage" x:TypeArguments="ImageSource">
<StackLayout VerticalOptions="End">
<StackLayout IsVisible="{Binding NoConnection}" x:Name="ButtonStackLayout" Orientation="Horizontal" Spacing="10" Padding="10,10,10,10" BackgroundColor="#E3E3E3">
<StackLayout HorizontalOptions="Start">
<Label x:Name="ButtonLabel" BackgroundColor="#E3E3E3" Text="Retry" TextColor="Black" VerticalOptions="Center" />
</StackLayout>
<StackLayout HorizontalOptions="CenterAndExpand"></StackLayout>
<StackLayout HorizontalOptions="End">
<Image x:Name="ButtonImage" BackgroundColor="#E3E3E3" WidthRequest="24" Source="{StaticResource RefreshImage}" VerticalOptions="Center" />
</StackLayout>
</StackLayout>
<StackLayout VerticalOptions="End">
<StackLayout IsVisible="{Binding NoConnection}" x:Name="ButtonStackLayout" Orientation="Horizontal" Spacing="10" Padding="10,10,10,10" BackgroundColor="#E3E3E3">
<StackLayout HorizontalOptions="StartAndExpand">
<Label x:Name="ButtonLabel" BackgroundColor="#E3E3E3" Text="Retry" TextColor="Black" VerticalOptions="Center" />
</StackLayout>
<StackLayout HorizontalOptions="EndAndExpand">
<Image x:Name="ButtonImage" BackgroundColor="#E3E3E3" WidthRequest="24" Source="{StaticResource RefreshImage}" VerticalOptions="Center" />
</StackLayout>
</StackLayout>
</StackLayout>
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ButtonWithImage.MainPage"
Title="Button Image Sample"
BackgroundColor="White">
<ContentPage.Resources>
<ResourceDictionary>
<OnPlatform x:Key="RefreshImage" x:TypeArguments="ImageSource">
(function() {
'use strict';
angular.module('app').
factory('authService', ['$http', '$q', '$window',
function($http, $q, $window) {
const storage = $window.localStorage;
let cacheToken = {};
return {
getAuthorizationHeader() {
if (cacheToken.access_token && cacheToken.expires_on > moment(new Date().getTime()).unix()) {
var Spinner = React.createClass({
render() {
return (
<div className="container">
<div className="row center-align">
<div className="col s12">
<div className="preloader-wrapper big active">
<div className="spinner-layer spinner-green-only">
<div className="circle-clipper left">
<div className="circle"></div>
var Dashboard = React.createClass({
getInitialState() {
return {isLoading: true}
},
componentDidMount() {
var _My = new My()
var L = _My.MakeLenses(GHConst.githubApiFields)
var getGithub = url => new Future(function(reject, response) {
$.getJSON(url)
@pragmaticlogic
pragmaticlogic / main.jsx
Last active August 29, 2015 14:21
onKeyDownHandler
var onKeyDownHandler = ((event) => {
//Impure
var element = this.refs.searchText.getDOMNode()
var focusElement = ((value) => { this.refs.searchText.getDOMNode().value = '' }).bind(this)
var showResult = value => { Navigate(`/dashboard/${value}`) }
//Pure
var isInputEmpty = R.eq('')
var checkInput = R.compose(isInputEmpty, R.trim)
var Route = React.createClass({
mixins: [RouterMixin],
routes: {
'/': 'home'
,'notfound/:userName': 'notfound'
,'dashboard/:userName': 'dashboard'
,'repos/:userName': 'repos'
},