Skip to content

Instantly share code, notes, and snippets.

@codelynx
codelynx / CoreGraphics+Z.swift
Last active November 28, 2016 04:28
CoreGraphics Geometric Utilities [Swift 3.0]
//
// GeoUtils.swift
// ZKit
//
// The MIT License (MIT)
//
// Copyright (c) 2016 Electricwoods LLC, Kaz Yoshikawa.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@hilen
hilen / UIBarButtonItem+Block.swift
Last active February 15, 2023 12:08
Custom UINavigationItem and custom back item with block . Swift 2.0
//
// UIBarButtonItem+Block.swift
// IllidanSpeed
//
// Created by Hilen on 12/10/15.
// Copyright © 2015 IllidanSpeed. All rights reserved.
//
import Foundation
@celoyd
celoyd / hi8-anim-howto.md
Last active August 1, 2022 15:37
A way to make Himawari-8 animations

Himawari-8 animation tutorial

Here’s how to make animations like this one. It requires intermediate Unix command-line knowledge, to install some tools and to debug if they don’t work. You’ll need these utilities:

  • curl (or you can translate to wget)
  • convert and montage, part of ImageMagick
  • ffmpeg, plus whatever codecs
  • parallel, for iteration that’s nicer than shell for loops or xargs
  • run everything in zsh for leading 0s in numerical ranges to work
@natecook1000
natecook1000 / CalculatorView.swift
Last active June 6, 2022 01:00
An IBInspectable Calculator Construction Set
// CalculatorView.swift
// as seen in http://nshipster.com/ibinspectable-ibdesignable/
//
// (c) 2015 Nate Cook, licensed under the MIT license
/// The alignment for drawing an String inside a bounding rectangle.
enum NCStringAlignment {
case LeftTop
case CenterTop
case RightTop
@tado
tado / realtime_fft.pde
Last active August 29, 2015 14:11
Realtime FFT Analysis for Processing
// Processing realtime FFT analysis
import processing.sound.*;
AudioIn input;
FFT fft;
int bands=512;
float[] spectrum = new float[bands];
public void setup() {
@cocopon
cocopon / Easing.pde
Last active January 28, 2023 04:05
A class that brings Robert Penner's easing functions into Processing
/*
* Easing.pde - brings Robert Penner's easing functions into Processing
* (c) 2015 cocopon.
*
* See the following to learn more about these famous functions:
* http://www.robertpenner.com/easing/
*
* License:
* http://www.robertpenner.com/easing_terms_of_use.html
*/
@yoshimin
yoshimin / gist:858d14751fc1c00807d2
Created August 10, 2014 17:06
NSAttributedStringを使ってリンク文字を作る
#import "YMNViewController.h"
NSString *const Text = @"The iOS Developer Program provides a complete and integrated process for developing and distributing iOS apps on the App Store. Learn more";
NSString *const LinkText = @"Learn more";
@interface YMNViewController ()
@property (nonatomic, strong) UITextView *textView;
@property (nonatomic, strong) UITapGestureRecognizer *tapGesture;
@yoshimin
yoshimin / gist:81f7cbc22050b7e83e29
Created August 10, 2014 16:09
CoreTextで描画した文字をリンカブルにする(タップされたら文字をハイライトさせる)
#import "YMNCoreTextView.h"
#import <CoreText/CoreText.h>
#import <QuartzCore/QuartzCore.h>
@interface YMNCoreTextView()
@property (nonatomic, strong) NSMutableAttributedString *attributedString;
@property (nonatomic, assign) CTFrameRef drawingFrame;
@property (nonatomic, assign) NSRange linkableWordRange;
@shimizukawa
shimizukawa / 201723133-Billing-FAQ.rst
Last active August 16, 2018 02:13
【Slack FAQ 翻訳】 2014/6/23 支払いFAQ - Billing FAQ - Slack Help Center
@correia
correia / swift-kvo-example.swift
Last active April 16, 2023 02:38
A quick example for how to use Foundation style KVO from Swift. (Official documentation from Apple is forthcoming.)
//
// Swift-KVO
//
// Created by Jim Correia on 6/5/14.
// Copyright (c) 2014-2015 Jim Correia. All rights reserved.
//
// Update: 6/17/2014
//
// KVOContext has gone away; use the same idiom you'd use from Objective-C for the context
//