Skip to content

Instantly share code, notes, and snippets.

@munho
munho / customPainter.dart
Created December 16, 2021 06:27 — forked from OPY-bbt/customPainter.dart
draw network image in CustomPainter and save content to file
import 'dart:io';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
void main() => runApp(MyApp());
String FILENAME = 'timg.jpeg';
@munho
munho / 101-rx-samples.md
Created December 9, 2021 03:21 — forked from minhhungit/101-rx-samples.md
101 Rx Samples in C#

101 Rx Samples in C#

This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.

Here's the unedited original, translated to Github Markdown glory:

101 Rx Samples - a work in progress

@munho
munho / KeyboardAccessoryView.swift
Created June 8, 2021 08:55 — forked from Winchariot/KeyboardAccessoryView.swift
UIToolbar with a right-aligned "Done" button, for use as a keyboard accessory view
lazy var accessoryToolbarWithDoneButton: UIToolbar = {
let toolbar = UIToolbar(frame: CGRect.zero)
//only needs to be flexible in the dimension(s) you want it to be
//https://stackoverflow.com/questions/31822504/how-can-i-increase-the-height-of-an-inputaccessoryview
toolbar.autoresizingMask = [.flexibleWidth, .flexibleHeight]
let leftSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(keyboardDoneButtonTapped(_:)))
toolbar.items = [leftSpace, doneButton]
@munho
munho / makeImage.sh
Created March 2, 2021 00:56 — forked from bitboxer/makeImage.sh
create a sparsebundle for mac os backups
#!/bin/bash
# A bash script to create a time machine disk image suitable for
# backups with OS X 10.6 (Snow Leopard)
# This script probably only works for me, so try it at your own peril!
# Use, distribute, and modify as you see fit but leave this header intact.
# (R) sunkid - September 5, 2009
#
# This will create a time machine ready disk image named with your
# computer's name with a maximum size of 600GB and copy it to
# /Volumes/backup. The image "file" (it's a directory, really) will
@munho
munho / default
Last active February 23, 2021 06:27 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /usr/local/var/log/nginx/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
apply plugin: 'kotlin-kapt'
// ...(중략)...
dependencies {
// for async logic
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
// Room
implementation "androidx.room:room-runtime:2.2.2"
@munho
munho / UIViewController+Rotation.m
Created January 11, 2021 01:57 — forked from macguru/UIViewController+Rotation.m
Forcing a rotation on a UIViewController.
//
// UIViewController+Rotation.m
// Ulysses
//
// Created by Götz Fabian on 12.10.17.
// Copyright © 2017 Ulysses GmbH & Co. KG. All rights reserved.
//
#import "UIViewController+Rotation.h"

Understanding UIViewController Rotation

Problem

To enable the rotation of a single view controller used to display the preview of Images/Videos. It is intuitive to allow user to rotate there device and screen changes accordingly, so it feels pleasant. But to achieve this, we need to enable the (almost) all Supported Device orientations.

Ex: `Portrait`, `LandscapeLeft`, `LandscapeRight`.
@munho
munho / osmc-raspberrypi2.md
Last active November 14, 2020 09:06 — forked from inceax/osmc-raspberrypi2.md
raspberry pi 3에 osmc 빠른 세팅을 위한 개인 설정 기록

osmc 세팅

한글화

스킨 한글화

  1. 폰트 설치
sudo apt-get install fonts-nanum
@munho
munho / osmc-on-raspberrypi.md
Created November 14, 2020 04:43 — forked from sujak/osmc-on-raspberrypi.md
Raspberry Pi 에 OSMC (Open Source Media Centre) 설치 및 설정

OSMC 설치

  1. OSMC 웹사이트에서 인스톨러 다운로드 ( https://osmc.tv/download/ )
  2. 인스톨러에서 필요한 옵션을 선택 (자동으로 설치 파일 다운로드 및 메모리에 복사)
  3. 메모리를 라즈베리파이에 삽입 후 전원 연결
  4. 자동으로 설치완료 및 재부팅

설정