Skip to content

Instantly share code, notes, and snippets.

View tastyone's full-sized avatar
💭
Happy! Look at my eyes~

Sangwon Park tastyone

💭
Happy! Look at my eyes~
View GitHub Profile
@nathanborror
nathanborror / ContentView.swift
Last active October 30, 2022 13:26
SwiftUI wrapper around Slack's PanModal (https://github.com/slackhq/PanModal)
import SwiftUI
import PanModal
struct ExampleView: View {
@State var detail: AnyView? = nil
@State var items: [String] = ["Detail 1", "Detail 2", "Detail 3"]
var body: some View {
NavigationView {
//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16
@DaanGeurts
DaanGeurts / housekeeping_images.sh
Created June 20, 2019 11:11
Deleting unused images from Google Container Registry, leaving x number left
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@drscotthawley
drscotthawley / greenscreen.py
Last active December 10, 2021 07:21
greenscreen.py: Greenscreen effect without a physical green screen, via OpenCV and Python
#! /usr/bin/env python
'''
greenscreen.py: Greenscreen effect without a physical green screen
This performs background subtraction, and sets the background to "green" for use with "key frame" video editing software
Author: Scott Hawley, https://github.com/drscotthawley
Requirements:
Python, NumPy and OpenCV
I got these via Macports, but Homebrew, etc. work.
@chrisveness
chrisveness / index.html
Last active January 3, 2023 06:50
JavaScript AES client/server interoperability test
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AES client/server test</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css">
<style>
body { font-size: 80%; padding: 1em; }
form { margin-top: 2em; }
label { display: inline-block; width: 6em; }
@muukii
muukii / MTKCIImageView.swift
Created September 28, 2015 05:32
CIImageView (Using Metal)
//
// MTKCIImageView.swift
// Fil
//
// Created by Muukii on 9/27/15.
// Copyright © 2015 muukii. All rights reserved.
//
import Foundation
import Metal
@yutelin
yutelin / String+AES.swift
Last active January 22, 2024 12:36
String+AES.swift
import Foundation
import CryptoSwift
extension String {
func aesEncrypt(key: String, iv: String) throws -> String{
let data = self.dataUsingEncoding(NSUTF8StringEncoding)
let enc = try AES(key: key, iv: iv, blockMode:.CBC).encrypt(data!.arrayOfBytes(), padding: PKCS7())
let encData = NSData(bytes: enc, length: Int(enc.count))
let base64String: String = encData.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0));
@yannickl
yannickl / YLColor.swift
Last active September 16, 2023 03:55
Hex string <=> UIColor conversion in Swift
import Foundation
import UIKit
extension UIColor {
convenience init(hexString:String) {
let hexString:NSString = hexString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
let scanner = NSScanner(string: hexString)
if (hexString.hasPrefix("#")) {
scanner.scanLocation = 1
@deepankarb
deepankarb / svg-to-android.sh
Last active July 14, 2018 13:13
A script to generate android assets from a SVG file. Requires inkscape to resize and convert.
#!/bin/bash
if [[ -z "$1" ]];
then
echo "No SVG file specified. Exiting."
exit -1
fi
ispng=$(file $1)
echo $ispng | grep -q SVG
#!/bin/bash
: << '#__REM__'
指定さたライブラリをAndroid用にフルオートで作成します。ダウンロード、toolchainsの作成、複数のアーキテクチャのビルドも自動的に行います。デフォルトではarmv5te、armv7-a、mips1、i386のアーキテクチャを作成します。
Create a full-auto for Android the library specified. Creating download, toolchains, build the architecture of multiple automatically. Create architecture, mips1, i386 armv5te, armv7-a by default.
#__REM__
TARGET_VERSION="1.3.1"