Skip to content

Instantly share code, notes, and snippets.

View yfujiki's full-sized avatar
💭
Moving around

Yuichi Fujiki yfujiki

💭
Moving around
  • Athlee Ltd
  • Japan
View GitHub Profile
@floriankugler
floriankugler / AutoLayoutHelpers.swift
Last active August 30, 2023 21:17
Very simple key path based Auto Layout helpers
import UIKit
typealias Constraint = (UIView, UIView) -> NSLayoutConstraint
func equal<L, Axis>(_ to: KeyPath<UIView, L>, constant: CGFloat = 0) -> Constraint where L: NSLayoutAnchor<Axis> {
return equal(to, to, constant: constant)
}
func equal<L, Axis>(_ from: KeyPath<UIView, L>, _ to: KeyPath<UIView, L>, constant: CGFloat = 0) -> Constraint where L: NSLayoutAnchor<Axis> {
return { view1, view2 in
@katowulf
katowulf / enable_debug_logging.java
Last active August 18, 2023 03:15
Enable debug logging in Firestore in Java, Javascript, or Swift.
/******* Android **********/
// See https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FirebaseFirestore.html#setLoggingEnabled(boolean)
FirebaseFirestore.setLoggingEnabled(true);
/******* Server-side Java **********/
/**
See https://medium.com/@hiranya911/logging-in-java-libraries-for-firebase-and-google-cloud-platform-f8742493b73f
1) Add the slf4j-simple binding to the application classpath
2) Set the -Dorg.slf4j.simpleLogger.defaultLogLevel=debug system property
**/
@328
328 / App.js
Created March 28, 2018 06:07
react nativeでwindow sizeを取得して画面いっぱいまで画像を拡大表示する
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
var Dimensions = require('Dimensions');
var { width, height, scale } = Dimensions.get('window'); //get window size
import React, { Component } from 'react';
@roycoding
roycoding / Transfer_learning.ipynb
Created March 14, 2018 04:05
Transfer learning example (fast.ai Dogs vs Cats image classifier) on Google Colab
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
public protocol Selfie: CustomStringConvertible {}
extension Selfie {
var description: String {
let mirror = Mirror(reflecting: self)
return "\(mirror.subjectType)( \(mirror.children.map({ "\($0!): \($1) "}).joinWithSeparator(", ")))"
}
}
@kotakanbe
kotakanbe / mohikan_slack_channels.md
Last active October 14, 2023 19:26
モヒカンslack( https://mohikan.slack.com )のチャネルリスト
@seanwoodward
seanwoodward / ViewController-snippet.m
Last active August 29, 2015 13:57
Auto-incrementing a value with UIButton and NSTimer or just use UIStepper
@interface ViewController
@property (nonatomic, weak) IBOutlet UILabel *numberLabel;
@property (nonatomic, strong) NSTimer *numberTimer;
@property (nonatomic, assign) double value;
@property (nonatomic, assign) BOOL cancelTimer;
@property (nonatomic, assign) NSTimeInterval timeInterval;
- (void)updateNumberLabel;
- (void)stopTimer;
@devmanuj
devmanuj / gist:5926753
Last active December 19, 2015 08:38
Script for extracting optimised images from an ipa file using Xcode utility PNGCRUSH.
Running this script requires that you rename the exptension of ipa to zip and then move images in payload folder to a common folder in which this ExtractedImages.sh exists. Run this script it should find all the images and extract it in RevertedImages folder.
#!/bin/bash
#create a folder to put reverted images in
mkdir RevertedImages
#looping for png files in . or $1 parameter
for png in `find . -name '*.png'`
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@skeeet
skeeet / xcode_ramdisk.sh
Created April 12, 2012 13:35 — forked from MaximKeegan/xcode_ramdisk.sh
Create a RAM disk for using with XCode
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"