Skip to content

Instantly share code, notes, and snippets.

@seka
seka / Sample.swift
Created Apr 27, 2020
NSDataとCFDataの関係をメモ (Toll-Free Bridge)
View Sample.swift
import Foundation
var data: NSData = NSData.init(bytes: "Hello, World!", length: 13)
withUnsafePointer(to: data) {
print("value \(String(describing: data)) has address: \($0)")
}
var cfData: CFData = data
withUnsafePointer(to: cfData) {
@seka
seka / HTMLConverter.kt
Created Oct 21, 2018
HTML から Android のコンポーネントを作成してみるサンプル
View HTMLConverter.kt
package jp.example.android.util.html
import android.content.Context
import android.graphics.Bitmap
import android.support.v4.content.ContextCompat
import android.text.SpannableString
import android.text.SpannableStringBuilder
import android.text.Spanned.SPAN_INCLUSIVE_INCLUSIVE
import android.text.style.TextAppearanceSpan
import android.view.Gravity.CENTER
@seka
seka / ThemeColorPicker.swift
Last active May 23, 2017
カラーピッカー的なものを作ってみた
View ThemeColorPicker.swift
//
// ThemeColorPicker.swift
//
// Created by PxP_ss on 2014/11/05.
// Copyright (c) 2014年 pxp_ss. All rights reserved.
//
import UIKit
protocol ThemeColorPickerDelegate {
@seka
seka / gist:bf0a7ec699aaf0fa2368590f11044aad
Last active Oct 25, 2016
リクエストのサンプル
View gist:bf0a7ec699aaf0fa2368590f11044aad
{
"lunch_id": int,
"separateSize": int,
"members": [
{
"user_id": int,
"user_name": string,
"user_sex": boolean
"user_expense_times": int
"user_select_shop_times": int
View alphabetical.json
{
"sort-order": [
"align-content",
"align-items",
"align-self",
"-o-animation",
"-ms-animation",
"-moz-animation",
"-webkit-animation",
"animation",
@seka
seka / ScrollViewController.swift
Last active Aug 16, 2016
views infinite scrolling - 擬似的な無限スクロールを実装
View ScrollViewController.swift
//
// ScrollViewController.swift
// ScrollView
//
// Created by PxP_ss on 2014/10/08.
// Copyright (c) 2014年 pxp_ss. All rights reserved.
//
import UIKit
@seka
seka / gist:c5894488d7e07d583630
Created Jan 31, 2016
postcss-style-guide のテストに使ったファイル
View gist:c5894488d7e07d583630
var gulp = require('gulp');
var fs = require('fs');
var postcss = require('gulp-postcss');
var scss = require('postcss-scss');
var styleguide = require('postcss-style-guide');
gulp.task('default', function () {
var processors = [
styleguide
@seka
seka / SocketServerMongoMemoryStore2.coffee
Created Dec 1, 2013
SocketServerMongoMemoryStore.coffee を書きなおして一つのクラスにしてみた.
View SocketServerMongoMemoryStore2.coffee
exports.SocketServerClass = class SocketServerClass
_sioListenPort = 8080
constructor : (@app, @node_modules, @appOption) ->
@sio = @node_modules.sio
@http = @node_modules.http
@appServer = @http.createServer(@app)
# session --------------------
@mongoose = require 'mongoose'
@seka
seka / SocketServerMongoMemoryStore.coffee
Created Nov 30, 2013
Node.jsのメモリーストアをmongoDBに設定した後に、Socket.io側からアクセスしたくて 色々調べてもよく分からなかったので、自分で実装してみた.(mongooseを使ったのは甘え)
View SocketServerMongoMemoryStore.coffee
exports.SocketServerClass = class SocketServerClass
_sioListenPort = 8080
constructor : (@app, @node_modules, @appOption) ->
@sio = @node_modules.sio
@http = @node_modules.http
@appServer = @http.createServer(@app)
setup : () ->
# socketioの起動
View 10000: HelloWorld.c
#include <stdio.h>
int main(void)
{
printf("Hello World\n");
return (0);
}