text:
package net.runelite.http.service.feed;

import com.google.common.hash.HashCode;
import com.google.common.hash.Hasher;
import com.google.common.hash.Hashing;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import net.runelite.http.api.feed.FeedItem;
import net.runelite.http.api.feed.FeedResult;
import net.runelite.http.service.feed.blog.BlogService;
import net.runelite.http.service.feed.osrsnews.OSRSNewsService;
import net.runelite.http.service.feed.twitter.TwitterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.CacheControl;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/feed")
@Slf4j
public class FeedController
{
	private final BlogService blogService;
	private final TwitterService twitterService;
	private final OSRSNewsService osrsNewsService;

	private static class MemoizedFeed
	{
		final FeedResult feedResult;
		final String hash;

		MemoizedFeed(FeedResult feedResult)
		{
			this.feedResult = feedResult;

			Hasher hasher = Hashing.sha256().newHasher();
			for (FeedItem itemPrice : feedResult.getItems())
			{
				hasher.putBytes(itemPrice.getTitle().getBytes()).putBytes(itemPrice.getContent().getBytes());
			}
			HashCode code = hasher.hash();
			hash = code.toString();
		}
	}

	private MemoizedFeed memoizedFeed;

	@Autowired
	public FeedController(BlogService blogService, TwitterService twitterService, OSRSNewsService osrsNewsService)
	{
		this.blogService = blogService;
		this.twitterService = twitterService;
		this.osrsNewsService = osrsNewsService;
	}

	@Scheduled(fixedDelay = 10 * 60 * 1000)
	public void updateFeed()
	{
		List<FeedItem> items = new ArrayList<>();

		try
		{
			items.addAll(blogService.getBlogPosts());
		}
		catch (Exception e)
		{
			log.warn("unable to fetch blogs", e);
		}

		try
		{
			items.addAll(twitterService.getTweets());
		}
		catch (Exception e)
		{
			log.warn("unable to fetch tweets", e);
		}

		try
		{
			items.addAll(osrsNewsService.getNews());
		}
		catch (Exception e)
		{
			log.warn("unable to fetch news", e);
		}

		memoizedFeed = new MemoizedFeed(new FeedResult(items));
	}

	@GetMapping
	public ResponseEntity<FeedResult> getFeed()
	{
		if (memoizedFeed == null)
		{
			return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE)
				.cacheControl(CacheControl.noCache())
				.build();
		}

		return ResponseEntity.ok()
			.eTag(memoizedFeed.hash)
			.cacheControl(CacheControl.maxAge(10, TimeUnit.MINUTES).cachePublic())
			.body(memoizedFeed.feedResult);
	}
}


text:
var player;
var intv;
var slider;
//Init
//
////////////////////////////
window.onload = function()
{
    document.getElementById('btnPlay').addEventListener('click', playMusic, false);
    document.getElementById('btnPause').addEventListener('click', pauseMusic, false);
    document.getElementById('btnStop').addEventListener('click', stopMusic, false);
    document.getElementById('btnMute').addEventListener('click', muteMusic, false);
    player = document.getElementById('player');
    updateVolume(1);
}

//Play music
function playMusic(){
    player.play();
    intv = setInterval(update, 100);
    //slider.max = player.duration;
    getFullTime();
}

//Pause the music
function pauseMusic(){
    player.pause();
    clearInterval(intv);
}

//Stop the music
function stopMusic(){
    player.pause();
    player.currentTime = 0;
    document.getElementById('currentPourcent').style.width = 0;
    document.getElementById('songTime').innerHTML = millisToMins(player.currentTime);
    clearInterval(intv);
}

//Mute the music
function muteMusic(){
    if(player.muted == true){
        player.muted = false;
        document.getElementById('currentVolume').style.maxWidth = "100%";
    }else{
        player.muted = true;
        document.getElementById('currentVolume').style.maxWidth = "0";
    }
}

function updateVolume(volume){
    player.volume = volume;
    //Reposition the cursor for the player
    updateVolumeWidth();
    document.getElementById('currentVolume').style.maxWidth = "100%";
    if(player.volume > 0){
        player.muted = false;
    }
}

function volUp()
{
    if(player.volume < 1)
    {
        player.volume += 0.1;
    } else {
        player.volume = 1;
    }
    updateVolumeWidth();
}

function volDown()
{
    if(player.volume > 0)
    {
        player.volume -= 0.1;
    } else {
        player.volume = 0;
    }
    updateVolumeWidth();
}

function updateVolumeWidth(){
    document.getElementById('currentVolume').style.width=(player.volume * 100) + "%";
}

//All event to match keyboard event
$("body").keyup(function(e) {
    console.log(e.keyCode);
    switch(e.keyCode) {

        //If we touch Space
        case 32:
            if (player.paused == false) {
                pauseMusic();
            } else {
                playMusic();
            }
        break;
        //If we touche "M" for mute
        case 77:
            muteMusic();
        break;

        //If we touch "+"
        case 187:
            volUp();
        break;

        //If we touch "-"
        case 189:
            volDown();
        break;

        //Default
        default:
            console.log('No keyboard matching');
    }
});

//Function to update the second on the player
function update(){
    document.getElementById('songTime').innerHTML = millisToMins(player.currentTime);
    var currentTimeUp = player.currentTime;
    var durationUp = player.duration;
    var currentPourcent = (currentTimeUp/durationUp) * 100;
    document.getElementById('currentPourcent').style.width = currentPourcent + "%";
    buffer();
}

function buffer(){
    var currentTime = player.currentTime;
    var duration = player.duration;
    var buffer = player.buffered.end(player.buffered.length-1);
    document.getElementById('bufferPourcent').style.width = ( buffer / duration ) * 100 + "%";
}

//Function to get the fulle time of a music
function getFullTime()
{
    document.getElementById('songTimeFull').innerHTML = millisToMins(player.duration);
}

//Function to get second for the music
function millisToMins(seconds)
{
    var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60);
    var numseconds = (((seconds % 31536000) % 86400) % 3600) % 60;
    if (numseconds >= 10)
    {
        return numminutes + ":" + Math.round(numseconds);
    } else
    {
        return numminutes + ":0" + Math.round(numseconds);
    }
}

//Reposition of audio
function reposition(valuePosition)
{
    player.currentTime = valuePosition;
}

redpajama_set_name: RedPajamaGithub


text:
package org.killbill.billing.invoice.dao;

import org.killbill.billing.util.entity.Entity;
import org.killbill.billing.util.entity.dao.EntitySqlDao;
import org.killbill.commons.jdbi.template.KillBillSqlDaoStringTemplate;

@KillBillSqlDaoStringTemplate
public interface InvoiceBillingEventSqlDao extends EntitySqlDao<InvoiceBillingEventModelDao, Entity> {

}


text:
/* 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
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#define _CRANKVISUAL_INSIDE

#include <glib.h>
#include <glib-object.h>

#include <cogl/cogl2-experimental.h>

#include "cranklightable.h"

/**
 * SECTION: cranklightable
 * @title: CrankLightable
 * @short_description: Lightable Base Class
 * @stability: Unstable
 * @include: crankvisual.h
 *
 * Represents a lightable.
 *
 * Abstract function:
 *
 * * CrankLightableClass.get_visible_radius()
 */

//////// List of virtual functions /////////////////////////////////////////////

static void     crank_lightable_get_property (GObject    *object,
                                              guint       prop_id,
                                              GValue     *value,
                                              GParamSpec *pspec);

static void     crank_lightable_set_property (GObject      *object,
                                              guint         prop_id,
                                              const GValue *value,
                                              GParamSpec   *pspec);

//////// Properties and signals ////////////////////////////////////////////////

enum {
  PROP_0,
  PROP_PRIMARY_COLOR,

  PROP_COUNTS
};

static GParamSpec *pspecs[PROP_COUNTS] = {NULL};

//////// Type Definitions //////////////////////////////////////////////////////

typedef struct _CrankLightablePrivate
{
  CrankVecFloat3 primary_color;
} CrankLightablePrivate;

G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (CrankLightable, crank_lightable, CRANK_TYPE_VISIBLE);

//////// GTypeInstance /////////////////////////////////////////////////////////

static void
crank_lightable_init (CrankLightable *lightable)
{
  CrankLightablePrivate *priv;

  priv = crank_lightable_get_instance_private (lightable);

  crank_vec_float3_init_fill (& priv->primary_color, 1);
}

static void
crank_lightable_class_init (CrankLightableClass *c)
{
  GObjectClass *c_gobject = G_OBJECT_CLASS (c);

  c_gobject->get_property = crank_lightable_get_property;
  c_gobject->set_property = crank_lightable_set_property;

  pspecs[PROP_PRIMARY_COLOR] = g_param_spec_boxed (
      "primary-color", "Primary Color",
      "Primary color of lightable",
      CRANK_TYPE_VEC_FLOAT3,
      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS );

  g_object_class_install_properties (c_gobject, PROP_COUNTS, pspecs);
}

//////// GObject ///////////////////////////////////////////////////////////////

void
crank_lightable_get_property (GObject    *object,
                              guint       prop_id,
                              GValue     *value,
                              GParamSpec *pspec)
{
  CrankLightable *lightable = (CrankLightable*) object;
  CrankLightablePrivate *priv = crank_lightable_get_instance_private (lightable);

  switch (prop_id)
    {
    case PROP_PRIMARY_COLOR:
      g_value_set_boxed (value, & priv->primary_color);
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
    }
}

void
crank_lightable_set_property (GObject      *object,
                              guint         prop_id,
                              const GValue *value,
                              GParamSpec   *pspec)
{
  CrankLightable *lightable = (CrankLightable*) object;

  switch (prop_id)
    {
    case PROP_PRIMARY_COLOR:
      crank_lightable_set_primary_color (lightable,
                                         (CrankVecFloat3*) g_value_get_boxed (value));
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
    }
}

//////// Public functions //////////////////////////////////////////////////////

/**
 * crank_lightable_get_primary_color:
 * @lightable: A Lightable.
 * @color: (out): light's primary color.
 *
 * Gets primary color of this lightable.
 */
void
crank_lightable_get_primary_color (CrankLightable *lightable,
                                   CrankVecFloat3 *color)
{
  CrankLightablePrivate *priv = crank_lightable_get_instance_private (lightable);

  crank_vec_float3_copy (& priv->primary_color, color);
}

/**
 * crank_lightable_set_primary_color:
 * @lightable: A Lightable.
 * @color: light's primary color.
 *
 * Sets primary color of this lightable.
 */
void
crank_lightable_set_primary_color (CrankLightable *lightable,
                                   CrankVecFloat3 *color)
{
  CrankLightablePrivate *priv = crank_lightable_get_instance_private (lightable);

  crank_vec_float3_copy (color, & priv->primary_color);
}

/**
 * crank_lightable_render:
 * @lightable: A Lightable.
 * @position: Position of lightable in view's space.
 * @projection: Projection of view.
 * @tex_geom: Geometry buffer.
 * @tex_color: Color buffer.
 * @tex_mater: Material buffer.
 * @lscale: Light scaling.
 * @framebuffer: Framebuffer to render.
 *
 * Renders light with given material informations.
 */
void
crank_lightable_render (CrankLightable  *lightable,
                        CrankTrans3     *position,
                        CrankProjection *projection,
                        CoglTexture     *tex_geom,
                        CoglTexture     *tex_color,
                        CoglTexture     *tex_mater,
                        const gfloat     lscale,
                        CoglFramebuffer *framebuffer)
{
  CrankLightableClass *c = CRANK_LIGHTABLE_GET_CLASS (lightable);

  c->render (lightable, position, projection, tex_geom, tex_color, tex_mater, lscale, framebuffer);
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
NVTextureRectangle (LWJGL API)
</TITLE>

<META NAME="date" CONTENT="2012-11-04">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.lwjgl.opengl

Class NVTextureRectangle

java.lang.Object
  org.lwjgl.opengl.NVTextureRectangle

public final class NVTextureRectangle
extends java.lang.Object

Field Summary

static int
GL_MAX_RECTANGLE_TEXTURE_SIZE_NV

static int
GL_PROXY_TEXTURE_RECTANGLE_NV

static int
GL_TEXTURE_BINDING_RECTANGLE_NV

static int
GL_TEXTURE_RECTANGLE_NV

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

GL_TEXTURE_RECTANGLE_NV

public static final int GL_TEXTURE_RECTANGLE_NV

See Also:
Constant Field Values

GL_TEXTURE_BINDING_RECTANGLE_NV

public static final int GL_TEXTURE_BINDING_RECTANGLE_NV

See Also:
Constant Field Values

GL_PROXY_TEXTURE_RECTANGLE_NV

public static final int GL_PROXY_TEXTURE_RECTANGLE_NV

See Also:
Constant Field Values

GL_MAX_RECTANGLE_TEXTURE_SIZE_NV

public static final int GL_MAX_RECTANGLE_TEXTURE_SIZE_NV

See Also:
Constant Field Values

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2009 lwjgl.org. All Rights Reserved.


text:
#import "NSObject.h"

#import "NSCopying-Protocol.h"
#import "NSObject-Protocol.h"

@class NSDate;

@interface CSDateTime : NSObject <NSObject, NSCopying>
{
    NSDate *date;
}

+ (id)dateTimeWithTimeIntervalSince1970:(double)arg1;
+ (id)dateTimeWithTimeIntervalSinceNow:(double)arg1;
+ (id)now;
+ (void)initialize;
@property(retain) NSDate *date; // @synthesize date;
- (void).cxx_destruct;
- (void)decodeFromDictionary:(id)arg1;
- (id)encodeToDictionary;
- (id)description;
- (id)isoValue;
- (BOOL)isEqualTo:(id)arg1;
- (double)epochValue;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)init;
- (id)initWithDate:(id)arg1;

@end


text:
from __future__ import unicode_literals

from decimal import Decimal
from datetime import datetime, timedelta

from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from django.core.urlresolvers import reverse, reverse_lazy
from django.shortcuts import get_object_or_404, render, redirect
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView

from .forms import GiveQuoteForm, ResolutionForm, SettleForm, CloseOutForm
from .models import Invoice, InvoiceAlteration, CustomerConflict
from source_utils.permission_mixins import FinanceCheckMixin, SuperUserCheckMixin
from source_utils.view_mixins import DeleteViewMixin
from source_utils.starters import Conflict

from reportlab.pdfgen import canvas
from django.http import HttpResponse

from .printing import MyPrint
from io import BytesIO

def print_users(request, slug):
    invoice = get_object_or_404(Invoice, slug=slug)
    if invoice.work_order.work_completed and not invoice.due_by:
        invoice.due_by = datetime.now()+timedelta(days=35)
        invoice.save()

    title = 'attachment; first_name="{}.pdf"'.format(slug)
    # Create the HttpResponse object with the appropriate PDF headers.
    response = HttpResponse(content_type='application/pdf')
    response['Content-Disposition'] = 'attachment; filename={}'.format(
    	slug + "-invoice.pdf")

    buffer = BytesIO()

    report = MyPrint(buffer, 'Letter', slug)
    pdf = report.print_users()

    response.write(pdf)
    return response

class InvoiceMixin(FinanceCheckMixin):
    model = Invoice

class InvoicesOptionsListView(InvoiceMixin, ListView):
    success_url = reverse_lazy('customer_finance:invoice_lists')
    template_name = "customer_finance/optional_lists.html"
    paginate_by = 4

    def get_queryset(self):
        if self.args[0] == "owed":
            return Invoice.objects.filter(paid_in_full=False)
        elif self.args[0] == "conflicted":
            self.template_name = "customer_finance/conflicts.html"
            return CustomerConflict.objects.filter(conflict_resolution=None)
        elif self.args[0] == "active":
            return Invoice.objects.filter(closed_out=False)
        else:
            return Invoice.objects.all()

    def get_context_data(self, **kwargs):
        context = super(InvoicesOptionsListView, self).get_context_data(**kwargs)
        if self.args[0] == "owed":
            context['title'] = "Customer Invoices with Balances"
        elif self.args[0] == "conflicted":
            context['title'] = "Customer Invoices with Conflicts"
        elif self.args[0] == "active":
            context['title'] = "Active Customer Invoices"
        else:
            context['title'] = "All Customer Invoices"
        return context

class InvoiceDetailView(InvoiceMixin, DetailView):
    template_name = "customer_finance/invoice_detail.html"
    url_insert = "customer_finance:invoice_delete"

    def get_context_data(self, **kwargs):
        context = super(InvoiceDetailView, self).get_context_data(**kwargs)
        context['total_after_tax'] = self.object.invoice_quote.total_price_quoted
        context['total_tax'] = self.object.invoice_quote.tax_on_quote
        context['before_tax'] = self.object.invoice_quote.total_price_quoted - self.object.invoice_quote.tax_on_quote
        context['balance_due'] = self.object.get_balance_due()
        context['payment_schedule'] = self.object.get_payment_schedule()

        return context

class InvoiceEditMixin(InvoiceMixin, SuccessMessageMixin):
    template_name = 'form.html'

    def get_success_message(self, cleaned_data):
    	project_name = "{} - {}".format(
    		self.object.work_order.client.full_family_name(),
    		self.object.work_order.description)
    	return self.success_message % dict(
    		cleaned_data,
    		item=project_name
    	)

class InvoiceCreateView(InvoiceEditMixin, CreateView):
    success_message = "%(item)s was successfully created"
    title = "New Invoice"
    fields = ["work_order", "pricing", "tax", "note"]

class InvoiceUpdateView(InvoiceCreateView):
    success_message = "%(item)s was successfully updated"
    title = "Update Invoice"
    fields = ["pricing", "tax", "note"]

class InvoiceGiveQuoteView(InvoiceEditMixin, UpdateView):
    success_message = "%(item)s was successfully quoted"
    title = "Quote Invoice"
    form_class = GiveQuoteForm

    def form_valid(self, form):
        self.object.give_price_quote = True
        self.object = form.save()
        return super(InvoiceGiveQuoteView, self).form_valid(form)

class InvoiceCloseOutView(InvoiceEditMixin, UpdateView):
    success_message = "%(item)s was successfully closed out"
    form_class = CloseOutForm

    def get_initial(self):
        # self.get_the_data()
        initial = super(InvoiceCloseOutView, self).get_initial()
        initial['closed_out'] = True

        return initial

    def get_context_data(self, **kwargs):
        context = super(InvoiceCloseOutView, self).get_context_data(**kwargs)
        context['title'] = "Close Out \"{}\"".format(self.object)
        return context

    def form_valid(self, form):
        self.object.log += "Invoice closed out on {} by {}\n".format(
            datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
            self.request.user,
            )
        self.object = form.save()
        return super(InvoiceCloseOutView, self).form_valid(form)

class InvoiceDeleteView(DeleteViewMixin):
    model = Invoice
    success_url = reverse_lazy('customer_finance:invoice_lists', args=['active'])

# class InvoiceDeleteView(DeleteViewMixin):
#     model = Invoice
#     template_name = "delete.html"
#     success_url = reverse_lazy('customer_finance:invoice_lists', args=['active'])
#     success_message = "Order was successfully deleted"

#     def delete(self, request, *args, **kwargs):
#         obj = self.get_object()
#         obj.work_order.sent_to_finance = False
#         obj.work_order.save()
#         messages.success(self.request, self.success_message)
#         return super(InvoiceDeleteView, self).delete(request, *args, **kwargs)

class AlterationMixin(FinanceCheckMixin):
    model = InvoiceAlteration

class AlterationDetailView(AlterationMixin, DetailView):
    template_name = "customer_finance/alteration_detail.html"

class AlterationByInvoiceListView(AlterationMixin, ListView):
    template_name = "customer_finance/alteration_list.html"

    def get_queryset(self):
        self.this_invoice = get_object_or_404(Invoice, slug=self.args[0])
        return InvoiceAlteration.objects.filter(invoice=self.this_invoice)

    def get_context_data(self, **kwargs):
        context = super(
            AlterationByInvoiceListView, self).get_context_data(**kwargs
        )
        context['title'] = "Alteration for {}".format(self.this_invoice)
        return context

class AlterationCreateView(AlterationMixin, SuccessMessageMixin, CreateView):
    template_name = 'form.html'
    form_class = SettleForm
    success_message = "$%(item)s was successfully %(action)s to %(location)s"

    def get_initial(self):
    	self.invoice = get_object_or_404(Invoice, slug=self.kwargs.get('slug'))
    	return {
    	'invoice':self.invoice,
    	}

    def get_context_data(self, **kwargs):
    	context = super(AlterationCreateView, self).get_context_data(**kwargs)
    	context['title'] = "Settle {} Invoice".format(self.invoice)
    	context['balance'] = self.invoice.get_balance_due()
    	return context

    def get_success_message(self, cleaned_data):
        project_name = "{} - {}".format(
            self.object.invoice.work_order.client.full_family_name(),
            self.object.invoice.work_order.description)
        return self.success_message % dict(
            cleaned_data,
            item=self.object.transaction_amount,
            action=self.object.transaction_update,
            location=project_name
        )

class ConflictMixin(FinanceCheckMixin):
    model = CustomerConflict

class CustomerConflictMixin(ConflictMixin, SuccessMessageMixin):
    success_message = "Conflict was successfully %(action)s invoice %(location)s"
    template_name = 'form.html'
    action = "added to"

    def get_success_url(self):
        return reverse('customer_finance:invoice_lists', args=["conflicted"])

    def get_success_message(self, cleaned_data):
        project_name = "{} - {}".format(
            self.object.invoice.work_order.client.full_family_name(),
            self.object.invoice.work_order.description)
        return self.success_message % dict(
            cleaned_data,
            action=self.action,
            location=project_name
        )

class CustomerConflictCreateView(CustomerConflictMixin, CreateView):
    fields = ["invoice", "conflict_description"]

    def get_initial(self):
        self.invoice = get_object_or_404(Invoice, slug=self.kwargs.get('slug'))
        return {
            'invoice':self.invoice,
        }

    def get_context_data(self, **kwargs):
        context = super(CustomerConflictCreateView, self).get_context_data(**kwargs)
        context['title'] = "New Conflict for {}".format(self.invoice)
        return context

class CustomerConflictUpdateView(CustomerConflictMixin, UpdateView):
    fields = ["conflict_description"]

    def get_context_data(self, **kwargs):
        context = super(CustomerConflictUpdateView, self).get_context_data(**kwargs)
        context['title'] = "Update Conflict for {}".format(self.object.invoice)
        return context

class CustomerConflictResolveView(CustomerConflictMixin, UpdateView):
    form_class = ResolutionForm
    action = "resolved for"

    def get_context_data(self, **kwargs):
        context = super(CustomerConflictResolveView, self).get_context_data(**kwargs)
        context['title'] = "Resolve Conflict for {}".format(self.object.invoice)
        return context


text:
import os
import json
import subprocess
import cProfile
import pstats
import uuid
from functools import wraps
from .._compatibility import StringIO

from .._logging import get_logger

logger = get_logger('profiling')

class Profile(cProfile.Profile):
    def __init__(self, sortby='tottime', *args, **kwargs):
        self.sortby = sortby
        self.image_path = None
        super(Profile, self).__init__(*args, **kwargs)

    def _repr_html_(self):
        s = StringIO()
        stats = pstats.Stats(self, stream=s).sort_stats(self.sortby)
        stats.print_stats(10)
        stats_value = s.getvalue()
        html = '
{}
'.format(stats_value)
        if self.image_path:
            html += ''.format(self.image_path)
        return html

class profiling(object):
    def __init__(self, enable=True, output_path='profiling', uid=uuid.uuid4, info=None, sortby='tottime'):
        self.enable = enable
        self.output_path = output_path
        self.uid = uid
        self.info = info
        self.sortby = sortby

        self.enable_profiling = enable

    def __call__(self, func):

        @wraps(func)
        def func_wrapper(*args, **kwargs):
            enable_ = self.enable
            if callable(enable_):
                enable_ = enable_(*args, **kwargs)
                self.enable_profiling = bool(enable_)

            if self.enable_profiling:
                self.__enter__()
            response = None
            try:
                response = func(*args, **kwargs)
            except Exception:
                raise
            finally:
                if self.enable_profiling:
                    output_path_ = self.output_path
                    if callable(output_path_):
                        self.output_path = output_path_(*args, **kwargs)
                    uid_ = self.uid
                    if callable(uid_):
                        self.uid = uid_()
                    info_ = self.info
                    if callable(info_):
                        self.info = info_(response, *args, **kwargs)

                    self.__exit__(None, None, None)

            return response

        return func_wrapper

    def __enter__(self):
        pr = None
        if self.enable_profiling:
            pr = Profile(sortby=self.sortby)
            pr.enable()
        self.pr = pr
        return pr

    def __exit__(self, type, value, traceback):
        if self.enable_profiling:
            pr = self.pr
            pr.disable()
            # args accept functions
            output_path = self.output_path
            uid = self.uid
            info = self.info
            if callable(uid):
                uid = uid()

            # make sure the output path exists
            if not os.path.exists(output_path):  # pragma: no cover
                os.makedirs(output_path, mode=0o774)

            # collect profiling info
            stats = pstats.Stats(pr)
            stats.sort_stats(self.sortby)
            info_path = os.path.join(output_path, '{}.json'.format(uid))
            stats_path = os.path.join(output_path, '{}.pstats'.format(uid))
            dot_path = os.path.join(output_path, '{}.dot'.format(uid))
            png_path = os.path.join(output_path, '{}.png'.format(uid))
            if info:
                try:
                    with open(info_path, 'w') as fp:
                        json.dump(info, fp, indent=2, encoding='utf-8')
                except Exception as e:
                    logger.error('An error occurred while saving %s: %s.', info_path, e)
            stats.dump_stats(stats_path)
            # create profiling graph
            try:
                subprocess.call(['gprof2dot', '-f', 'pstats', '-o', dot_path, stats_path])
                subprocess.call(['dot', '-Tpng', '-o', png_path, dot_path])
                pr.image_path = png_path
            except Exception:
                logger.error('An error occurred while creating profiling image! '
                             'Please make sure you have installed GraphViz.')
            logger.info('Saving profiling data (%s)', stats_path[:-7])


text:
uid: BenchmarkDotNet.Samples.IntroInProcessWrongEnv
---

## Sample: IntroInProcessWrongEnv

### Source code

[!code-csharp[IntroInProcessWrongEnv.cs](../../../samples/BenchmarkDotNet.Samples/IntroInProcessWrongEnv.cs)]

### Output

### Links

* @docs.toolchains
* The permanent link to this sample: @BenchmarkDotNet.Samples.IntroInProcessWrongEnv

---


text:
define(function() {

var Collection = {};


text:
SELECT `_class`, `diff` FROM `ClockDifference` WHERE 1;

--
-- INSERT template for table `ClockDifference`
--
INSERT INTO `ClockDifference`(`_class`, `diff`) VALUES (?, ?);

--
-- UPDATE template for table `ClockDifference`
--
UPDATE `ClockDifference` SET `_class` = ?, `diff` = ? WHERE 1;

--
-- DELETE template for table `ClockDifference`
--
DELETE FROM `ClockDifference` WHERE 0;


text:
<?php

class PbErrors {
	private $errors;

	public function __construct() {
		$this->errors = array();
	}

	public function push($message, $table, $item, $level=PbError::PB_ERROR_LEVEL_ERROR) {
		$this->errors[] = new PbError($message, $table, $item, $level);
	}

	public function hasError() {
		return (is_empty($this->errors) ? false : true);
	}

	public function getErrors() {
		return $this->errors;
	}

	public function getMessages($plain=false) {
		$messages = array();
		/** @var PbError $error */
		if ($plain) {
			foreach($this->errors as $error) {
				$messages[] = $error->getMessage();
				return $messages;
			}
		}
		foreach($this->errors as $error) {
			$messages[$error->getTable()][$error->getItem()][] = $error->getMessage();
		}
		return $messages;
	}
}

class PbError {
	const PB_ERROR_LEVEL_WARNING = "warning";
	const PB_ERROR_LEVEL_ERROR = "error";
	const PB_ERROR_LEVEL_FATAL = "fatal";

	private $message;

	private $table;

	private $item;

	private $level;

	public function __construct($message, $table, $item, $level) {
		$this->message = $message;
		$this->table = $table;
		$this->item = $item;
		$this->level = $level;
	}

	/**
	 * @return string
	 */
	public function getMessage() {
		return $this->message;
	}

	/**
	 * @return string
	 */
	public function getTable() {
		return $this->table;
	}

	/**
	 * @return string
	 */
	public function getItem() {
		return $this->item;
	}

	/**
	 * @return string
	 */
	public function getLevel() {
		return $this->level;
	}

}


text:
layout: post
title: "My Blogging Workflow"
excerpt: "I've also noticed a number of people saying 'I want to get into it... but need to figure out x and y first."
modified: 2018-04-26 21:30:00 +1200'
date: 2018-04-26 21:30:00 +1200
tags: [meta, blogging]
comments: true
image:
 thumb: /blog-workflow/thumb.jpg
 credit: Mateusz Łapsa-Malawski
 creditlink: https://www.flickr.com/photos/munhitsu/4162953165/
---

Coming out of the [PowerShell + DevOps Summit](https://powershell.org/summit/)
and [PowerShell Conference Europe](http://www.psconf.eu/) there has been a
noticeable uptick in new blogs. I've also noticed a number of people saying "I
want to get into it... but need to figure out x and y first."

I've been meaning to document my workflow (which is sadly lacking in obvious
opportunities for automation) for writing blog posts and a little about the
backend this blog runs on. Now seems like a good time to get this written,
especially if it helps someone get their own blog off the ground.

### The Backend

This blog runs on [GitHub Pages](https://pages.github.com/) and you can see all
of the code behind it via its [GitHub
Repo](https://github.com/Windos/windos.github.io).

That first link has good instructions on how to get started with GitHub Pages.
The main thing to remember is that if you commit something to the master branch
of the repo, your site will be built automatically. If there are any issues
preventing the site from being built successfully you'll get an email.

I've, uh, had a few of those emails...

[![Failure](/images/blog-workflow/failure.png)](/images/blog-workflow/failure.png)

The biggest thing (for me) was finding a theme I liked. GitHub Pages has a stock
selection to pick from, and now even allow you to easily choose from a large
selection of community curated themes by [editing your configuration
file](https://blog.github.com/2017-11-29-use-any-theme-with-github-pages/).

In general, any Jekyll theme should work. You can just dump the theme into your
repo and see if GitHub manages it to build it, then go from there.

I ended up going with a theme called
[CodeInventory](https://github.com/codeinventory/codeinventory.github.io), which
I spent a while tweaking (read: hacking away at for weeks) to morph it into
something I was ok with.

### Little Green Padlock

You may have noticed that this blog isn't sitting on the default domain for
GitHub Pages (username.github.io). GitHub supports using custom domains, but
don't (yet) support HTTPS when doing so.

[![No HTTPS](/images/blog-workflow/nohttps.png)](/images/blog-workflow/nohttps.png)

However, this site does have a certificate and it is serving pages up over
HTTPS. To do this I'm using [Cloudflare](https://cloudflare.com). This gave me
the added benefit of using them to cache my site all over their network which
has improved load times (not that GitHub by itself was all that slow.)

This caching does mean that when I publish a new blog I generally go into my
Cloudflare account and purge the cache. If I don't do this it can take some time
for new posts to actually become available to readers.

### Get Your Branch On!

Remember when I mentioned that any commits to the master branch will result in a
build of your site being triggered? Well then how the heck do you do "drafts" or
just, you know, stop work in progress stuff being shown to the entire world?

Branches!

As I write this, I'm making commits to a "blog-workflow" branch, named after the
name of this post. The file I'm editing right now is
"2018-04-26-blog-workflow.md".

[![Branch](/images/blog-workflow/branch.png)](/images/blog-workflow/branch.png)

When I'm all finished writing, I merge the branch into master and the post goes
live. You can have as many branches on the go as you like. If you were following
along with my Summit recaps, I had used branches to preemptively get the
templates, titles and thumbnails for each post ready before I was even on my way
over to America.

[![Summit](/images/blog-workflow/summit.jpg)](/images/blog-workflow/summit.jpg)

### It All Starts with a Title and an Image

Ok, technically each of my posts starts with the idea for the blog post. But
nothing else happens before I have a title and a thumbnail image. I like to have
fun with these, and I try to go for "punny" titles (my goal is to make myself
laugh!)

For thumbnails I'll pick one word that summarizes the topic of the post and
start searching for an image. I try to keep to creative commons images,
generally via [Flickr](https://www.flickr.com/photos/astuteobserver/1439828491/)
and I always include credit in the markdown file for where the image came from.
Bonus points if I manage to find an image that makes me laugh while still
actually being related to the topic of the post.

### The Template

Next is the template, generally what I do to get this at the moment is make a
copy of the previous post and edit it.

Posts are all Markdown files with metadata at the top, and I keep this metadata
lean initially (for reasons which will become clear soon), initially it's just
the title and date.

Here is what this post started life as:

```markdown
---
title: "My Blogging Workflow"
date: 2018-04-26 23:00:00 +1200
---

Text

### Header

Text

### Header

This continues for a while... I'll cut it.

### Header

Text

Also, remember that if you're looking for [PowerShell
help](https://king.geek.nz/2018/03/20/pshelp-twitter/), you can find it on
Twitter using
[\#PSHelp](https://twitter.com/search?f=tweets&vertical=default&q=%23pshelp&src=typd)!
```

### Feel the Writage!

Now it's time to put fingers to keys.

*Yes, that previous line made me laugh. It's important to enjoy this sort of
thing.*

Normally I'd be editing Markdown files in
[Notepad++](https://notepad-plus-plus.org/), but I'm terrible at spelling and...
English. I've not yet found an extension for Notepad++ that can help with this
as well as Microsoft Word can.

I do use Notepad++ for the initial template creation and the final clean up
before merging to master, such as adding all of the metadata and changing out
fancy quote marks for "normal" ones.

In-between those times, when I'm doing the actual writing, I use a Markdown
plugin for Word called [Writage](http://www.writage.com/).

I **LOVE** this plugin.

I can write my posts in Word, with all of the grammar and spelling corrections
it provides. When I press save it ends up as a nicely formatted Markdown file.
Bold text uses the correct syntax, as to lists, hyperlinks, everything.

This is what this post looks like when you have it open in Word:

[![Writage](/images/blog-workflow/writage.png)](/images/blog-workflow/writage.png)

One thing I don't do via Writage is code snippets. It has a habit of wanting to
escape dollar signs and the like. I just note where the code is to go and drop
it in with Notepad++ at the end.

### Other Tools

I don't use them enough, but when I include a GIF, it's generally been recorded
using [GifCam](http://blog.bahraniapps.com/gifcam/).

I also pass any and all PNG files through
[PNGGauntlet](https://pnggauntlet.com/). This optimizes PNGs so that their file
size isn't larger than it needs to be (I like to make sure I'm not making my
posts load slower than they have to.)

### Finishing Touches

Once I'm done writing, I save (including a git commit) and fire the md file up
in Notepad++.

I normalize any characters, like quotes and ellipses. I technically don't have
to outside of code samples, but it's a personal preference.

I drop in all code samples. In this specific posts case, the template from
earlier isn't included yet, but a not telling me to do it later.

Image links are included. Like code these are just noted to deal with them later
until this point.

Finally, the rest of the metadata is filled out. The reason I don't include it
from the start is that Writage rips it out when you open the markdown file if
it's something it doesn't understand. This metadata includes an excerpt (which
will show on Twitter and some other social media), the categories/tags, and the
thumbnail with credit links.

Once this is done, I'll read through once to looks for obvious typos and syntax
issues.

I'll then commit and read the rendered Markdown on the GitHub site. I'm looking
for anything that didn't render correctly but I also tend to pick out typos here
more so than the previous read through.

Lastly, I merge the post and read the post on my site. My hope is I no longer
find any issues, but if I do I'll correct them and commit directly to the master
branch.

### Wrap Up

That's all there is to the mechanics of how these blog posts are done. There are
options for automating a number of these steps which I really need to get to at
some stage. But the process is working for me at the moment.

Did this post help you get your own blog running? If so, please let me know on
[Twitter](https://twitter.com/WindosNZ) or in the comments. I'll consider this
post a success if it helps even one person!

Also, remember that if you're looking for [PowerShell
help](https://king.geek.nz/2018/03/20/pshelp-twitter/), you can find it on
Twitter using
[\#PSHelp](https://twitter.com/search?f=tweets&vertical=default&q=%23pshelp&src=typd)!


text:
package org.ethereum.net;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.*;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.ByteToMessageDecoder;
import io.netty.handler.codec.MessageToMessageCodec;
import io.netty.handler.codec.MessageToMessageDecoder;
import io.netty.handler.codec.MessageToMessageEncoder;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

import java.util.List;

/**
 * Created by Anton Nashatyrev on 16.10.2015.
 */
public class NettyTest {
    @Test
    public void pipelineTest() {

        final int[] int2 = new int[1];
        final boolean[] exception = new boolean[1];

        final ByteToMessageDecoder decoder2 = new ByteToMessageDecoder() {
            @Override
            protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
                int i = in.readInt();
                System.out.println("decoder2 read int (4 bytes): " + Integer.toHexString(i));
                int2[0] = i;
                if (i == 0) out.add("aaa");
            }
            @Override
            public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
                System.out.println("Decoder2 exception: " + cause);
            }
        };

        final MessageToMessageCodec decoder3 = new MessageToMessageCodec<Object, Object>() {
            @Override
            protected void decode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception {
                System.out.println("NettyTest.decode: msg = [" + msg + "]");
                if (msg == "aaa") {
                    throw new RuntimeException("Test exception 3");
                }
            }

            @Override
            protected void encode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception {
                throw new RuntimeException("Test exception 4");
            }

            @Override
            public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
                System.out.println("Decoder3 exception: " + cause);
                exception[0] = true;
            }
        };

        final ByteToMessageDecoder decoder1 = new ByteToMessageDecoder() {
            @Override
            protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
                int i = in.readInt();
                System.out.println("decoder1 read int (4 bytes). Needs no more: " + Integer.toHexString(i));
                ctx.pipeline().addAfter("decoder1", "decoder2", decoder2);
                ctx.pipeline().addAfter("decoder2", "decoder3", decoder3);
                ctx.pipeline().remove(this);
            }

            @Override
            public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
                System.out.println("Decoder1 exception: " + cause);
            }
        };

        ChannelInboundHandlerAdapter initiator = new ChannelInboundHandlerAdapter() {
            @Override
            public void channelActive(ChannelHandlerContext ctx) throws Exception {
                ctx.pipeline().addFirst("decoder1", decoder1);
                System.out.println("NettyTest.channelActive");
            }
        };

        EmbeddedChannel channel0 = new EmbeddedChannel(new ChannelOutboundHandlerAdapter() {
            @Override
            public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
                throw new RuntimeException("Test");
            }
            @Override
            public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
                System.out.println("Exception caught: " + cause);
            }

        });
        EmbeddedChannel channel = new EmbeddedChannel(initiator);
        ByteBuf buffer = Unpooled.buffer();
        buffer.writeInt(0x12345678);
        buffer.writeInt(0xabcdefff);
        channel.writeInbound(buffer);
        Assert.assertEquals(0xabcdefff, int2[0]);

        channel.writeInbound(Unpooled.buffer().writeInt(0));
        Assert.assertTrue(exception[0]);

        // Need the following for the exception in outbound handler to be fired
        // ctx.writeAndFlush(msg).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);

//        exception[0] = false;
//        channel.writeOutbound("outMsg");
//        Assert.assertTrue(exception[0]);
    }

}


text:
module Mixcloud
  class Section
    attr_accessor :track_url, :position, :start_time, :section_type

    def initialize(track_url, position, start_time, section_type)
      @track_url = track_url
      @position = position
      @start_time = start_time
      @section_type = section_type
    end
  end
end


text:
/**
 * Author: Kylin Soong
 */

package com.jcommerce.core.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "ad_position")
public class AdPosition extends ModelObject {

	private Long id;

	@Id
	@GeneratedValue
	@Basic(optional = false)
	@Column(name = "id", nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	private static final long serialVersionUID = 4521841867219529430L;
	private String positionName;
	private int adWidth;
	private int adHeight;
	private String positionDescription;
	private String positionStyle;

	private Set<Advertisement> advertisements = new HashSet<Advertisement>();

	@Basic( optional = true )
	@Column( name = "position_name", length = 60  )
	public String getPositionName() {
		return positionName;
	}

	public void setPositionName(String positionName) {
		this.positionName = positionName;
	}

	@Basic( optional = true )
	@Column( name = "ad_width"  )
	public int getAdWidth() {
		return adWidth;
	}

	public void setAdWidth(int adWidth) {
		this.adWidth = adWidth;
	}

	@Basic( optional = true )
	@Column( name = "ad_height"  )
	public int getAdHeight() {
		return adHeight;
	}

	public void setAdHeight(int adHeight) {
		this.adHeight = adHeight;
	}

	@Basic( optional = true )
	@Column( name = "position_desc", length = 255  )
	public String getPositionDescription() {
		return positionDescription;
	}

	public void setPositionDescription(String positionDescription) {
		this.positionDescription = positionDescription;
	}

	@Basic( optional = true )
	@Column( name = "position_style", length = 2147483647  )
	public String getPositionStyle() {
		return positionStyle;
	}

	public void setPositionStyle(String positionStyle) {
		this.positionStyle = positionStyle;
	}

	@OneToMany( fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = "adPosition"  )
 	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
	@Basic( optional = false )
	@Column( name = "position_id", nullable = false  )
	public Set<Advertisement> getAdvertisements() {
		return this.advertisements;
	}

	public void addAdvertisement(Advertisement advertisement) {
		advertisement.setAdPosition(this);
		this.advertisements.add(advertisement);
	}

	public void setAdvertisements(final Set<Advertisement> advertisement) {
		this.advertisements = advertisement;
	}

}


text:
@interface KISObservationHandlerTest : XCTestCase

@property (nonatomic, strong) KISKvoObject *observed;

@property (nonatomic, strong) KISObservationHandler *observer;

@property (nonatomic, strong) KISBlockObservation *observation;

@property (nonatomic, assign) NSUInteger notificationCount;

@end

@implementation KISObservationHandlerTest

- (void)setUp
{
	[super setUp];
	self.notificationCount = 0;
	self.observed = [KISKvoObject new];
	self.observer = [[KISObservationHandler alloc] init];
	self.observation = [[KISBlockObservation alloc] initWithObserver:self observable:self.observed options:0 keyPath:kKvoPropertyKeyPath1 block:^(KISNotification *notification) {
		self.notificationCount += 1;
	}];
}

- (void)testAddObservations
{
	[self.observer addObservation:self.observation];
	XCTAssertEqual(self.observer.observations.count, 1U, @"Should have two elements that we have just added.");
}

- (void)testNotification
{
	[self.observer addObservation:self.observation];
	self.observation = nil; // the observer should retain the observation.

	self.observed.kvoProperty1 = YES;
	XCTAssertEqual(self.notificationCount, 1U, @"Should be notified twice since the observation is add twice.");
}

#pragma mark - Remove

- (void)testRemoveOnNil
{
	KISBlockObservation *obs1 = [[KISBlockObservation alloc] initWithObserver:self observable:self.observed options:0 keyPath:kKvoPropertyKeyPath1 block:^(KISNotification *notification) {}];
	[self.observer addObservation:obs1];
	XCTAssertNoThrow([self.observer removeObservationOfObject:nil]);
	XCTAssertEqual(self.observer.observations.count, 1U);
}

- (void)testRemoveOnNonObserved
{
	KISBlockObservation *obs1 = [[KISBlockObservation alloc] initWithObserver:self observable:self.observed options:0 keyPath:kKvoPropertyKeyPath1 block:^(KISNotification *notification) {}];
	[self.observer addObservation:obs1];
	[self.observer removeObservationOfObject:self];
	XCTAssertEqual(self.observer.observations.count, 1U);
}

- (void)testRemoveOnObservable
{
	KISBlockObservation *obs1 = [[KISBlockObservation alloc] initWithObserver:self observable:self.observed options:0 keyPath:kKvoPropertyKeyPath1 block:^(KISNotification *notification) {}];
	KISBlockObservation *obs2 = [[KISBlockObservation alloc] initWithObserver:self observable:self.observed options:0 keyPath:kKvoPropertyKeyPath1 block:^(KISNotification *notification) {}];
	KISBlockObservation *obs3 = [[KISBlockObservation alloc] initWithObserver:self observable:self options:0 keyPath:kKvoPropertyKeyPath1 block:^(KISNotification *notification) {}];
	[self.observer addObservation:obs1];
	[self.observer addObservation:obs2];
	[self.observer addObservation:obs3];
	[self.observer removeObservationOfObject:self.observed];
	XCTAssertEqual(self.observer.observations.count, 1U);
}

- (void)testRemove
{
	[self.observer addObservation:self.observation];
	[self.observer removeObservationOfObject:self.observation.observable forKeyPath:self.observation.keyPath];
	XCTAssertEqual(self.observer.observations.count, 0U, @"Should have only the element.");
}

- (void)testRemoveUnknownObservation
{
	XCTAssertNoThrow([self.observer removeObservationOfObject:self.observation.observable forKeyPath:self.observation.keyPath]);
}

- (void)testRemoveAll
{
	[self.observer addObservation:self.observation];
	[self.observer removeAllObservations];
	XCTAssertEqual(self.observer.observations.count, 0U, @"Should have only the element.");
}

- (void)testDeallocShouldRemoveAll
{
	[self.observer addObservation:self.observation];
	self.observation = nil; // the observer should retain the observation.
	self.observer = nil; // Anything should retain the observation.
	self.observed.kvoProperty1 = YES; // Try to trigger the KVO
	XCTAssertEqual(self.notificationCount, 0U, @"Shouldn't be notified by the notification because it is deallocated.");
}

#pragma mark - isObserving

- (void)testIsObserving
{
	[self.observer addObservation:self.observation];
	XCTAssertTrue([self.observer isObservingObject:self.observation.observable forKeyPath:kKvoPropertyKeyPath1], @"Should observe the given object.");
}

- (void)testIsNOTObservingKeyPath
{
	[self.observer addObservation:self.observation];
	XCTAssertFalse([self.observer isObservingObject:self.observation.observable forKeyPath:kKvoPropertyKeyPaths], @"Should NOT observe this path.");
}

- (void)testIsNOTObservingObject
{
	[self.observer addObservation:self.observation];
	XCTAssertFalse([self.observer isObservingObject:self forKeyPath:kKvoPropertyKeyPath1], @"Should NOT observe this object.");
}

@end


text:
canary
======

CANary, The Vector CAN dbc format handling toolset


text:
/**
 */
package de.uka.ipd.sdq.dsexplore.qml.profile.util;

import de.uka.ipd.sdq.dsexplore.qml.declarations.QMLDeclaration;

import de.uka.ipd.sdq.dsexplore.qml.profile.*;

import de.uka.ipd.sdq.identifier.Identifier;

import namedelement.NamedElement;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.util.Switch;

/**
 *
 * The Switch for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the caseXXX method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 *
 * @see de.uka.ipd.sdq.dsexplore.qml.profile.ProfilePackage
 * @generated
 */
public class ProfileSwitch<T> extends Switch<T> {
	/**
	 * The cached model package
	 *
	 *
	 * @generated
	 */
	protected static ProfilePackage modelPackage;

	/**
	 * Creates an instance of the switch.
	 *
	 *
	 * @generated
	 */
	public ProfileSwitch() {
		if (modelPackage == null) {
			modelPackage = ProfilePackage.eINSTANCE;
		}
	}

	/**
	 * Checks whether this is a switch for the given package.
	 *
	 *
	 * @param ePackage the package in question.
	 * @return whether this is a switch for the given package.
	 * @generated
	 */
	@Override
	protected boolean isSwitchFor(EPackage ePackage) {
		return ePackage == modelPackage;
	}

	/**
	 * Calls caseXXX for each class of the model until one returns a non null result; it yields that result.
	 *
	 *
	 * @return the first non-null result returned by a caseXXX call.
	 * @generated
	 */
	@Override
	protected T doSwitch(int classifierID, EObject theEObject) {
		switch (classifierID) {
			case ProfilePackage.SIMPLE_QML_PROFILE: {
				SimpleQMLProfile simpleQMLProfile = (SimpleQMLProfile)theEObject;
				T result = caseSimpleQMLProfile(simpleQMLProfile);
				if (result == null) result = caseGenericQMLProfile(simpleQMLProfile);
				if (result == null) result = caseQMLDeclaration(simpleQMLProfile);
				if (result == null) result = caseIdentifier(simpleQMLProfile);
				if (result == null) result = caseNamedElement(simpleQMLProfile);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ProfilePackage.GENERIC_QML_PROFILE: {
				GenericQMLProfile genericQMLProfile = (GenericQMLProfile)theEObject;
				T result = caseGenericQMLProfile(genericQMLProfile);
				if (result == null) result = caseQMLDeclaration(genericQMLProfile);
				if (result == null) result = caseIdentifier(genericQMLProfile);
				if (result == null) result = caseNamedElement(genericQMLProfile);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ProfilePackage.REQUIREMENT: {
				Requirement requirement = (Requirement)theEObject;
				T result = caseRequirement(requirement);
				if (result == null) result = caseIdentifier(requirement);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ProfilePackage.REFINED_QML_PROFILE: {
				RefinedQMLProfile refinedQMLProfile = (RefinedQMLProfile)theEObject;
				T result = caseRefinedQMLProfile(refinedQMLProfile);
				if (result == null) result = caseGenericQMLProfile(refinedQMLProfile);
				if (result == null) result = caseQMLDeclaration(refinedQMLProfile);
				if (result == null) result = caseIdentifier(refinedQMLProfile);
				if (result == null) result = caseNamedElement(refinedQMLProfile);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ProfilePackage.USAGE_SCENARIO_REQUIREMENT: {
				UsageScenarioRequirement usageScenarioRequirement = (UsageScenarioRequirement)theEObject;
				T result = caseUsageScenarioRequirement(usageScenarioRequirement);
				if (result == null) result = caseRequirement(usageScenarioRequirement);
				if (result == null) result = caseIdentifier(usageScenarioRequirement);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case ProfilePackage.ENTRY_LEVEL_SYSTEM_CALL_REQUIREMENT: {
				EntryLevelSystemCallRequirement entryLevelSystemCallRequirement = (EntryLevelSystemCallRequirement)theEObject;
				T result = caseEntryLevelSystemCallRequirement(entryLevelSystemCallRequirement);
				if (result == null) result = caseRequirement(entryLevelSystemCallRequirement);
				if (result == null) result = caseIdentifier(entryLevelSystemCallRequirement);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			default: return defaultCase(theEObject);
		}
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Simple QML Profile'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Simple QML Profile'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSimpleQMLProfile(SimpleQMLProfile object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Generic QML Profile'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Generic QML Profile'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseGenericQMLProfile(GenericQMLProfile object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Requirement'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Requirement'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseRequirement(Requirement object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Refined QML Profile'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Refined QML Profile'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseRefinedQMLProfile(RefinedQMLProfile object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Usage Scenario Requirement'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Usage Scenario Requirement'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseUsageScenarioRequirement(UsageScenarioRequirement object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Entry Level System Call Requirement'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Entry Level System Call Requirement'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseEntryLevelSystemCallRequirement(EntryLevelSystemCallRequirement object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Identifier'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Identifier'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseIdentifier(Identifier object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'Named Element'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'Named Element'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseNamedElement(NamedElement object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'QML Declaration'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'QML Declaration'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseQMLDeclaration(QMLDeclaration object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of 'EObject'.
	 *
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch, but this is the last case anyway.
	 *
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of 'EObject'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
	 * @generated
	 */
	@Override
	public T defaultCase(EObject object) {
		return null;
	}

} //ProfileSwitch


text:
__DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source ${__DIR}/development.sh
# Based on development ---^

export DEPLOY_ENV="$(basename "${BASH_SOURCE[0]}" .sh)"
export NODE_ENV="test"

export TRISSUES_SERVER_PORT="8000"
export TRISSUES_GITHUB_REPO="pivotaltracker/trissues"
export TRISSUES_TRACKER_PROJECTID=101
export TRISSUES_AUTH_GITHUB="fake-test-token"
export TRISSUES_AUTH_TRACKER="fake-test-token"


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>BaseWeb – A fresh front-end development framework.</title>

  <link rel="icon" type="image/png" sizes="32x32" href="/docs/img/favicon.png">

  <link rel="stylesheet" type="text/css" media="all" href="/docs/css/baseweb.min.css">

BaseWeb

     Settings

 Palette

 Media

 Grid

 Typography

 Global

     Core

 Functions

 Mixins

 Media

 Grid

     Elements

 Base

 Typography

 Lists

 Blockquotes

 Code

 Tables

 Images

 Rules

 Forms

 Buttons

 Icons

 Videos

     Blocks

 Button Groups

 Notices

 Breadcrumbs

     Custom

 Custom

About

Usage

      Currently v1.2.0
      Download BaseWeb

Documentation

Settings

This is where we store all of our global project variables and maps. Variables and maps that are used in core modules, multiple element and/or block modules go here.

 Palette

 Media

 Grid

 Typography

 Global

BaseWeb is designed so that elements or blocks with specific variables are stored locally within that modules file. This is to keep your code organization consistent with its scope.

Documentation

Settings

Palette Variables

Where our framework colors are defined. There are a total of three primary colors, three secondary colors and six tertiary colors which are the combination of a primary and secondary color. There are also five modifiers that can apply to any color: light, lighter, dark, darker and pale.

In combination with our gray scale, that is a total of 80 unique color variables. To make them easy to remember, every color's naming schema follows this pattern: color name then the modifier (if any is used). For the color name itself, if it's a tertiary color, it starts with the primary color first, then the secondary that it's mixed with.

// $[primary]-[modifier]
$blue-light

// $[secondary]-[modifier]
$orange-darker

// $[primary]-[secondary]-[modifier]
$yellow-green-lighter

The degree variables are what's used to determine the amount that each base color is either lightened or darkened. The gray scale is the only exception to this.

Degree Modifiers

$light-deg 5%

$lighter-deg 10%

$dark-deg 5%

$darker-deg 10%

Black & White

$black

$white

        <input type="text" class="input" onclick="this.select()" value="$gray-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$gray-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$gray-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$gray" readonly>

        <input type="text" class="input" onclick="this.select()" value="$gray-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$gray-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-orange-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-orange-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-orange-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-orange" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-orange-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-orange-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$orange-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$orange-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$orange-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$orange" readonly>

        <input type="text" class="input" onclick="this.select()" value="$orange-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$orange-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-orange-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-orange-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-orange-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-orange" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-orange-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-orange-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-green-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-green-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-green-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-green" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-green-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$yellow-green-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$green-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$green-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$green-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$green" readonly>

        <input type="text" class="input" onclick="this.select()" value="$green-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$green-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-green-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-green-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-green-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-green" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-green-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-green-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-violet-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-violet-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-violet-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-violet" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-violet-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$blue-violet-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$violet-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$violet-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$violet-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$violet" readonly>

        <input type="text" class="input" onclick="this.select()" value="$violet-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$violet-darker" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-violet-pale" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-violet-lighter" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-violet-light" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-violet" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-violet-dark" readonly>

        <input type="text" class="input" onclick="this.select()" value="$red-violet-darker" readonly>

Documentation

Settings

Media Query Variables

Where media query breakpoints are defined. Global media breakpoints are set within the $breakpoints map while the $tweakpoints map is defined but no values are set. Any number of breakpoints can be added to the $breakpoints map and called on using the media query mixins.

Tweakpoints Map

$tweakpoints() ...

Breakpoints Map

$breakpoints('small') 480px

$breakpoints('medium') 760px

$breakpoints('large') 990px

$breakpoints('huge') 1380px

Setting Tweakpoint Maps

Tweakpoints are media queries that are used to finesse page elements without making any major changes to the layout. These points are usually component specific so there are none set by default. Instead, if a tweakpoint is needed, it should be defined at the top of a component file that requires it, then reset at the bottom of that component's file.

// Inside `_some_component.scss`
// Set our component specific tweakpoints
$tweakpoints: ({
  'inline': 300px,
  'block': 500px
});

// Your component code goes here...

// Reset tweak points so it doesn't
// leak to our next component file
$tweakpoints: ();

For more information on the tweakpoints method, make sure you checkout Hugo Giraudel's article over at Sitepoint: Breakpoints and Tweakpoints in Sass.

Documentation

Settings

Grid System Variables

All grid variables are defined within the $grid and $mini-grid maps and are used as the default settings for all grid system mixins and functions. You can modify these settings directly to effect all grid systems, or pass in a custom map to specific mixins.

Global Grid Settings

    $grid('type')
    normal

Set the grid type to normal or mobile to output their respective grid styles.

    $grid('total-width')
    100%

Use same unit type as $grid('gutter-width').

    $grid('gutter-width')
    0

Use same unit type as $grid('total-width'). Used to set left and right margin of columns.

    $grid('inner-gutter-width')
    20px

Used to set using left and right padding of columns.

$grid('columns') 12

Container Settings

$grid('container-margin') auto

$grid('container-padding') 20px

$grid('container-min-width') none

$grid('container-max-width') 1000px

Grid Class Names

$grid('class-container') container

$grid('class-row') row

$grid('class-column') col

    $grid('class-prefix')
    prefix

Set to none to disable output

    $grid('class-suffix')
    suffix

Set to none to disable output

Mini Grid System

    $mini-grid('fractions')
    12

Used to determine the number of fraction classes to output.

    $mini-grid('class-has')
    has

Class name for mini-grid parent classes.

    $mini-grid('class-is')
    is

Class name for mini-grid children classes.

Documentation

Settings

Typography Variables

The default typographic settings. These dictate the base typographic styles for headings, body text, inline text elements and links as well as modifier classes.

Font Families

    $font-family-sans
    "Helvetica Neue", "HelveticaNeue", helvetica, arial, sans-serif

    $font-family-serif
    georgia, "Times New Roman", times, serif

    $font-family-mono
    Menlo, Monaco, Consolas, "Courier New", monospace

Base Font Styles

$base-font-family $font-family-sans

$base-font-size 16px

$base-line-height 1.5em

$base-font-weight normal

Header Styles

$font-family-heading inherit

$line-height-heading 1.25em

$font-weight-heading bold

Text Color Assignment

$color

$color-light

$color-dark

$color-header

Links

$color-link

$color-link-hover

Header Links

$color-link-heading

$color-link-heading-hover

Miscellaneous

$letter-spacing 1px

Documentation

Settings

Global Variables

The rest of the global variables used in BaseWeb. These mainly deal with things like general framework settings, mixin defaults and structure or scaffolding colors.

Framework Settings

    $global-box-sizing
    border-box
    Set to null to not output global box sizing styles in scss/elements/_base.scss

    $class-clearfix
    clearfix
    Set to null to not output the clearfix class in scss/elements/_base.scss

    $class-remove-clearfix
    remove-clearfix
    Set to null to not output the remove-clearfix class in scss/elements/_base.scss

    $class-float-left
    float-left
    Set to null to not output the float-left class in scss/elements/_base.scss

    $class-float-left
    float-left
    Set to null to not output the float-left class in scss/elements/_base.scss

Mixin Defaults

$box-sizing border-box

$box-shadow 0 1px 3px rgba($black, 0.1)

$border-radius 3px

$transition all 0.25s linear

$transition-property all

$transition-duration 0.25s

$transition-timing-function linear

$transition-delay 0.25s

Scaffolding

$bg-color

$bg-selection

$border-color

$border-color-hover


text:
This gem adds some basic string validation and coercion methods into the BellyPlatform

## Installation

Add this line to your application's Gemfile:

    gem 'belly_platform_string_validations'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install belly_platform_string_validations

## Usage

### Validation

The `validate` method will check the following types and return either `true` or `false`:

`integer`,`int`,`boolean`,`date`,`timestamp`,`double`,`array_of_integers`,`array_of_ints`,`array_of_strings`,`snake_case`,`geopoint`,`string`

```
BellyPlatform::String.validate('integer', '123')
=> true
```

The `coerce` method will attempt to coerce the following types:

`integer`,`int`,`boolean`,`double`,`array_of_integers`,`array_of_ints`,`array_of_strings`,`timestamp`

```
BellyPlatform::String.coerce('integer', '123')
=> 123
```

The `Boolean` class provides methods to interpret a wide range of truthy and falsy values as boolean:

```
TRUTHY_VALUES = [true, "true", "t", "yes", "yep", "yea", "y", 1, "1"]
FALSY_VALUES  = [false, "false", "f", "no", "nope", "na", "n", 0, "0"]
```

```
BellyPlatform::Boolean.convert('yes')
=> true
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request