Skip to content

Instantly share code, notes, and snippets.

View kkebo's full-sized avatar
📱
Using iPad Pro 13” (M4)

Kenta Kubo kkebo

📱
Using iPad Pro 13” (M4)
View GitHub Profile
@uhtred
uhtred / mixin-linear-gradient.scss
Created July 23, 2014 21:49
SASS: Mixin Linear Gradient
@mixin linear-gradient( $start: #f1f1f1, $from: 0%, $stop: #d9d9d9, $to: 100% ) {
background: $start;
background: -webkit-gradient(linear, left top, left bottom, from(ie-hex-str($start)), to(ie-hex-str($stop)));
background: -moz-linear-gradient(center top, $start $from, $stop $to);
background: -moz-gradient(center top, $start $from, $stop $to);
background: -webkit-linear-gradient(top, $start $from,$stop $to);
background: -o-linear-gradient(top, $start $from,$stop $to);
background: -ms-linear-gradient(top, $start $from,$stop $to);
background: linear-gradient(to bottom, $start $from,$stop $to);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#{ie-hex-str($start)}', endColorstr='#{ie-hex-str($stop)}',GradientType=0 );
@pudquick
pudquick / pipista.py
Created November 20, 2012 07:23
pipista - pip module (for installing other modules) for Pythonista
import os, os.path, sys, urllib2, requests
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def _chunk_report(bytes_so_far, chunk_size, total_size):
if (total_size != None):
@aki-null
aki-null / gist:1497649
Created December 19, 2011 15:23
Core Text APIを使用した際に起こる行間の問題の回避
NSFont *normalFont = [NSFont systemFontOfSize:12];
CGRect renderFrame = CGRectMake(0, 0, 300, 50); // box to render the text into
static NSLayoutManager *layMan = nil;
if (!layMan) {
layMan = [NSLayoutManager new];
}
CGFloat lineHeight = [layMan defaultLineHeightForFont:normalFont]; // calculate the expected height of a line
NSDictionary *attrDict = [NSDictionary dictionaryWithObject:normalFont andKey:NSFontAttributeName];