Skip to content

Instantly share code, notes, and snippets.

View takuoka's full-sized avatar
Let's Rock

Takuya Okamoto takuoka

Let's Rock
View GitHub Profile
@mono0926
mono0926 / user_active.sql
Last active April 15, 2021 12:16
Firebase AnalyticsのBigQueryから、それぞれのユーザーの直近1ヶ月の最終アクティブ時刻を抽出
CREATE TEMPORARY FUNCTION
today() AS ( (
SELECT
CURRENT_DATE('Asia/Tokyo')) );
CREATE TEMPORARY FUNCTION
formatDate(d DATE) AS ( (
SELECT
FORMAT_DATE('%Y%m%d',d)) );
SELECT
user_id as userId,
import Cocoa
import MASShortcut
func pow() {
let rect = NSScreen.mainScreen()?.frame
let window = NSWindow(contentRect: rect!, styleMask: NSBorderlessWindowMask, backing: .Buffered, `defer`: false)
window.backgroundColor = NSColor.clearColor()
window.opaque = false
window.alphaValue = 1
window.makeKeyAndOrderFront(NSApplication.sharedApplication())
@gwengrid
gwengrid / TypeErasure.swift
Last active September 12, 2018 05:14
Example of type erasure with Pokemon
class Thunder { }
class Fire { }
protocol Pokemon {
typealias PokemonType
func attack(move:PokemonType)
}
struct Pikachu: Pokemon {
typealias PokemonType = Thunder
@takuoka
takuoka / SKTimingFunction.swift
Last active May 28, 2023 03:33
This is the TimingFunction class like CAMediaTimingFunction available in AnyWhere also SpriteKit. All the cool animation curves from `CAMediaTimingFunction` but it is limited to use with CoreAnimation. See what you can do with cubic Bezier curves here: http://cubic-bezier.com
//
// SKTimingFunction.swift
// Pods
//
// Created by Takuya Okamoto on 2015/10/06.
//
//
// inspired by https://gist.github.com/raphaelschaad/6739676
@natecook1000
natecook1000 / NSTimer+Closure.swift
Last active January 6, 2024 07:23
Scheduled NSTimer with a Swift closure
extension NSTimer {
/**
Creates and schedules a one-time `NSTimer` instance.
- Parameters:
- delay: The delay before execution.
- handler: A closure to execute after `delay`.
- Returns: The newly-created `NSTimer` instance.
*/
@tanjo
tanjo / README.md
Last active August 29, 2015 14:03
iOSシミュレータリセットさん

iOSシミュレータリセットさん

./ios_simulator_reseter.sh 
@adamgit
adamgit / .gitignore
Last active April 8, 2024 12:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#