View MyCell.swift
class FooCell: UICollectionViewCell {
private var sizingOnlyWidthConstraint: NSLayoutConstraint? = nil
func sizeWith(width: CGFloat, myString: String) -> CGSize {
if sizingOnlyWidthConstraint == nil {
sizingOnlyWidthConstraint = NSLayoutConstraint(item: self, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: width)
sizingOnlyWidthConstraint?.isActive = true
}
if sizingOnlyWidthConstraint!.constant != width {
View keychain.swift
func iterateKeychainItems(log: Bool, delete: Bool) {
let secItemClasses = [
kSecClassGenericPassword,
kSecClassInternetPassword,
kSecClassCertificate,
kSecClassKey,
kSecClassIdentity
]
if (log) {
View Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
gem 'cocoapods'
gem 'fastlane'
gem 'jazzy'
View appannie_histogram.R
#
# appannie_histogram.R
#
# Create weekly and monthly aggregations bar plots of your downloads
# from AppAnnie CSV files.
#
# Improvements:
#
# * First and last week of years can have much less than 7 days and create false
# decreases of downloads.
View test.css
body {
background-color: red;
}
View linear-optimization.rb
# Unit 8 of the Analytics Edge
#
# Minimize :
# z = (1 + 2) * X1 + (2 + 2.5) * X2 + 2.5 * X3 + X4 + 2 * X5 + (1 + 2 + 1) * X6
#
# Beamlet
# 1 - 1 2 2 0 0 0 0 0 0
# 2 - 0 0 0 1 2 2.5 0 0 0
# 3 - 0 0 0 0 0 0 1.5 1.5 2.5
# 4 - 1 0 0 2 0 0 1 0 0
View timezones.txt
# #ifdef DEBUG
# NSArray *timeZones = [NSTimeZone knownTimeZoneNames];
# for(NSString *timeZone in timeZones) {
# DDLogDebug(@"%@", timeZone);
# }
# #endif
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
View .bowerrc
{
"directory": "vendor/assets/components"
}
View random-bug.html
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://cdn-files.deezer.com/js/min/dz.js"></script>
<style type="text/css">
View SmackAPITest.java
package com.bootstragram.xmpp;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import junit.framework.TestCase;