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
protocol UIntToBytesConvertable { | |
var toBytes: [UInt8] { get } | |
} | |
extension UIntToBytesConvertable { | |
func toByteArr<T: BinaryInteger>(endian: T, count: Int) -> [UInt8] { | |
var _endian = endian | |
let bytePtr = withUnsafePointer(to: &_endian) { | |
$0.withMemoryRebound(to: UInt8.self, capacity: count) { | |
UnsafeBufferPointer(start: $0, count: count) |
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 Foundation | |
let size = MemoryLayout<Int16>.stride | |
let data = Data(bytes: [1, 0, 2, 0, 3, 0]) // little endian for 16-bit values | |
let int16s = data.withUnsafeBytes { (bytes: UnsafePointer<Int16>) in | |
Array(UnsafeBufferPointer(start: bytes, count: data.count / size)) | |
} | |
let length = data.count * MemoryLayout<Int16>.stride |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.filename = @"file.ext"; | |
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentDir = [documentPaths objectAtIndex:0]; | |
self.filePath = [documentDir stringByAppendingPathComponent:self.filename]; | |
[self createAndCheckDatabase]; |
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
pm list packages -f |
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
#!/bin/bash | |
. build/envsetup.sh | |
mmm frameworks/base/packages/SystemUI/ | |
adb start-server | |
adb shell pkill -TERM -f com.android.systemui | |
adb remount | |
adb push $OUT/system/priv-app/SystemUI.apk /system/priv-app/SystemUI.apk | |
adb shell pkill -TERM -f com.android.systemui | |
adb shell chmod 0644 /system/app-priv/SystemUI.apk | |
sleep 2 |
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
# Unreal Engine file types. | |
*.uasset filter=lfs diff=lfs merge=lfs -text | |
*.umap filter=lfs diff=lfs merge=lfs -text | |
# Raw Content file types. | |
*.fbx filter=lfs diff=lfs merge=lfs -text | |
*.3ds filter=lfs diff=lfs merge=lfs -text | |
*.psd filter=lfs diff=lfs merge=lfs -text | |
*.png filter=lfs diff=lfs merge=lfs -text | |
*.mp3 filter=lfs diff=lfs merge=lfs -text |
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
# This is a sample build configuration for JavaScript. | |
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples. | |
# Only use spaces to indent your .yml configuration. | |
# ----- | |
# You can specify a custom docker image from Docker Hub as your build environment. | |
image: node:8.12.0 | |
pipelines: | |
branches: |
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
master: | |
useSecurity: true | |
adminUser: "admin" | |
fsGroup: 1000 | |
runAsUser: 1000 | |
serviceType: ClusterIP | |
installPlugins: |
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
# Proccess: | |
# 1. Go into app directory | |
# 2. Get current versionCode and print it | |
# 3. Increment versionCode by one and print it | |
# 4. Get current versionName and print it | |
# 5. Ask user for new versionName and set it then print it | |
# 6. Stage changes to build.gradle | |
# 7. Go back one directory to project root | |
# 8. Commit version update with message Bumped up version | |
# 9. Tag with versionName |
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
#!/bin/bash | |
# | |
# usage: Make executable and type ./get_sdl.sh | |
# | |
# Note - Use -showBuildSettings such as: | |
# xcodebuild -configuration Release HEADER_SEARCH_PATHS="../../SDL/include/ ./Frameworks/FreeType.framework/Headers/" -target "Static Library" -arch x86_64 -sdk macosx -showBuildSettings | |
# to list all build settings... | |
# | |
# Note - Had to update the HEADER_SEARCH_PATHS and MACOSX_DEPLOYMENT_TARGET for | |
# a couple of libraries for the macOS versions. The HEADER_SEARCH_PATHS were set to look |