Skip to content

Instantly share code, notes, and snippets.

View mntone's full-sized avatar
🏠

monotone mntone

🏠
View GitHub Profile
@mntone
mntone / WebPImageSource.m
Created February 25, 2019 07:02
CGImage (RGB) from webp
#import <Foundation/Foundation.h>
#import <ImageIO/ImageIO.h>
#import <UIKit/UIKit.h>
#include "../libwebp/src/webp/types.h"
#include "../libwebp/src/webp/decode.h"
#include "../libwebp/src/webp/demux.h"
#import "WebPImageSource.h"
@mntone
mntone / UITraitCollection+Compatible.swift
Created February 7, 2019 02:51
UITraitCollection compatibility extension. under MIT license.
import UIKit
extension UITraitCollection {
public var compatible: UITraitCollectionCompatible {
return UITraitCollectionCompatible(self)
}
}
public struct UITraitCollectionCompatible {
private let traitCollection: UITraitCollection
@mntone
mntone / UIResponder+tree.swift
Created February 6, 2019 18:44
掃き溜めとして置いておきます
import UIKit
extension UIResponder {
public func find<T: UIResponder>() -> T? {
if let nextResponder = self.next {
if let nextResponder = nextResponder as? T {
return nextResponder
} else {
return nextResponder.find()
}
Pod::Spec.new do |s|
s.name = "UrlEncodedForm"
s.version = "1.0.5"
s.summary = "Parse and serialize url-encoded form data with Codable support."
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.homepage = "https://github.com/vapor/url-encoded-form"
s.author = { "vapor" => "github[at]vapor.codes" }
s.source = { :git => "https://github.com/vapor/url-encoded-form.git", :tag => "1.0.5" }
s.platform = :ios, '8.0'
s.requires_arc = true
@mntone
mntone / docker-compose.yml
Created August 26, 2018 06:22
docker-compose for project SSS
version: '3'
services:
nginx:
image: nginx:alpine
container_name: nginx
ports:
- "80:80"
volumes:
- "./conf.d:/etc/nginx/conf.d"
depends_on:
@mntone
mntone / NativeMethods.cs
Last active June 30, 2018 12:09
MSCMS (WCS) 関数群
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;
namespace Mntone.Sample
{
internal enum DeviceClassFlags : uint
{
/// <summary>
@mntone
mntone / clock.lua
Last active October 25, 2023 01:53
Sets a text source to act as a clock when the source is active. The format matches `strftime`. Use only in OBS Studio 21.0 and later!
obs = obslua
source_name = ""
tick = 1000
last_text = ""
format = ""
activated = false
local s_unit = 1000 * 1000 * 1000 -- [ns]
@mntone
mntone / main.gs
Created November 4, 2017 04:26
Google App Script の自動フォロー,DM script <This script is under The MIT License. | The MIT License にて>
'use strict';
// OAuth1認証用インスタンス
var twitter = TwitterWebService.getInstance(
'consumer_key',
'consumer_secret'
);
//OAuth1ライブラリを導入したうえで、getServiceを上書き
twitter.getService = function() {
@mntone
mntone / objc_ptr.hpp
Created June 18, 2017 11:39
MRC 環境でゴニョゴニョする何か。正直実用的でないし,ARC + C++ (Objective-C++) で綺麗に管理されるのでそれを使っておけ
#pragma once
template<typename T>
class objc_ptr {
protected:
T *ptr;
public:
inline objc_ptr() : ptr(nil) {}
inline explicit objc_ptr(T *p) : ptr(p) {if (ptr) [ptr retain];}
; Function compile flags: /Ogtpy
; File
; COMDAT decompress_r10l
_TEXT SEGMENT
input$ = 32
in_linesize$ = 40
start_y$ = 48
end_y$ = 56
output$ = 64
out_linesize$ = 72