This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# additional packages //https://github.com/kylef/swiftenv/issues/137 | |
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev systemtap-sdt-dev tzdata rsync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# apple guide (linux support) | |
https://swift.org/download/#using-downloads | |
# additional link reference | |
https://tecadmin.net/install-swift-ubuntu-1804-bionic/ | |
# dependency | |
sudo apt-get install clang libicu-dev | |
sudo apt-get install libcurl4 libpython2.7 libpython2.7-dev | |
sudo apt install gcc-aarch64-linux-gnu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIImage { | |
convenience init?(webPData: Data) { | |
var width: Int32 = 0, height: Int32 = 0 | |
if WebPGetInfo([UInt8](webPData), webPData.count, &width, &height) == 0 { | |
return nil | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local x_input = 0 | |
local y_input = 0 | |
local line_width = 32 | |
function love.update(dt) | |
x_input = (love.keyboard.isDown("right") and 1 or 0) - (love.keyboard.isDown("left") and 1 or 0) | |
y_input = (love.keyboard.isDown("down") and 1 or 0) - (love.keyboard.isDown("up") and 1 or 0) | |
end | |
function love.draw() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'etc' | |
require 'open-uri' | |
require 'optparse' | |
options = {} | |
opts = OptionParser.new do |opts| | |
opts.banner = "usage: p-eiget.rb" | |
opts.on('-c', '-c # cartridge') do |cart| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i location_of/your.mobileprovision) | |
/usr/libexec/PlistBuddy -c 'Print :Name' /dev/stdin <<< $(security cms -D -i location_of/your.mobileprovision) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *sample = @[@1, @2, @3, @4, @5]; | |
NSArray *sort = @[@1, @4, @5, @3, @2]; | |
NSMutableOrderedSet *order = [[NSMutableOrderedSet alloc] initWithArray:sample]; | |
NSUInteger insertIndex = 0; | |
for (NSNumber *ref in sort) { | |
NSUInteger presentIndex = [order indexOfObject:ref]; | |
if (presentIndex != NSNotFound) { | |
[order moveObjectsAtIndexes:[NSIndexSet indexSetWithIndex:presentIndex] toIndex:insertIndex]; | |
insertIndex++; |