This file contains hidden or 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
for f in "$@" | |
do | |
ext=${f##*.} | |
if [ $ext = "mov" ]; then | |
osascript -e 'display notification "'$f'" with title "Gif encode start"' | |
/usr/local/bin/ffmpeg -i $f -filter_complex "[0:v] fps=8,scale=600:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" $f.gif | |
osascript -e 'display notification "'$f'" with title "Gif encode end"' | |
fi | |
done |
This file contains hidden or 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 | |
extension Encodable { | |
func asDictionary(convertToSnakeCase: Bool = false) throws -> [String: Any] { | |
let encoder = JSONEncoder() | |
if convertToSnakeCase { encoder.keyEncodingStrategy = .convertToSnakeCase } | |
let data = try encoder.encode(self) | |
guard let dictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [String: Any] else { | |
throw NSError() | |
} | |
return dictionary |
This file contains hidden or 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
<GridView | |
android:id="@+id/gridview" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:verticalSpacing="0dp" | |
android:horizontalSpacing="0dp" | |
android:stretchMode="columnWidth" | |
android:numColumns="2"/> |
This file contains hidden or 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
recyclerView.also { recyclerView -> | |
val columnsNum = 3 | |
val layoutManager = GridLayoutManager(applicationContext, columnsNum) | |
layoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() { | |
override fun getSpanSize(position: Int): Int { | |
return when (position) { | |
0 -> columnsNum | |
else -> 1 | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Domains</key> | |
<dict> | |
<key>Applications</key> | |
<true/> | |
<key>Printing</key> | |
<true/> |
This file contains hidden or 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
public struct IntToBool: Codable { | |
public var value: Bool | |
public init(from decoder: Decoder) throws { | |
let container = try decoder.singleValueContainer() | |
let intValue = try container.decode(Int.self) | |
self.value = (intValue != 0) | |
} | |
public init(value: Bool) { |
This file contains hidden or 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
module.exports = {"light_on": | |
"2600ac00723a0d0f0d100d2c0d2c0d100c2d0c100d100c100d2c0d100c100d2c0d100c2d0c100d2c0d100c100d2c0d100c100d100c110c2d0c100d2c0d2c0d100c2d0c100d100c110c100c2d0c100d100c2d0c110c100c0009a1703a0d100c110c2c0d2d0c100c2d0c100d110b100d2c0d100c100d2c0d110b2d0d100c2d0c100d110b2d0c100d110b100d110b2d0c110c2c0d2c0d110b2d0c110c110b110c110b2d0c110c110c2c0d100c100d000d05000000000000000000000000", | |
"light_off":"2600ac00723a0d0f0d100d2c0d2c0d0f0d2c0d100d0f0d100d2c0d100c100d2c0d100c2d0c100d2c0d100c100d2c0d100d0f0d100c100d2c0d2c0d2c0d2c0d100d2c0d0f0d100d0f0d2d0c2d0c100d100c2d0c100d100c00099e733a0d100c100d2c0d2c0d100c2d0c100d100c100d2c0d100c110c2c0d100c2d0d0f0d2c0d100d100c2c0d110c100c100d100c2d0c2d0c2d0c2d0c100d2c0d100c100d100c2d0d2c0d100c100d2c0d0f0d100d000d05000000000000000000000000", | |
"aircon_off":"26005c030003eb00068c6c380d2b0c0f0c100c0f0d0f0c0f0d0f0c0f0d0f0c100c0f0c100c2b0c0f0d0f0c0f0d0f0c100c0f0c100c0f0d0f0c0f0d0f0c100c0f0c100c0f0d0f0c0f0d2a0d0f0c2b0c2b0d2a0d2a0d2b0c2b0c0f0d2a0d2a0d2b0c2b0c2b0c |
This file contains hidden or 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
var firebase = require("firebase"); | |
var config = { | |
apiKey: "秘密", | |
authDomain: "秘密.firebaseapp.com", | |
databaseURL: "https://秘密.firebaseio.com", | |
projectId: "秘密", | |
storageBucket: "", | |
messagingSenderId: "秘密" | |
}; | |
firebase.initializeApp(config); |
This file contains hidden or 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
class WeatherStationActivity : Activity() { | |
private var mDisplay: AlphanumericDisplay? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
Log.d(TAG, "Weather Station Started") | |
try { | |
mDisplay = RainbowHat.openDisplay() | |
mDisplay?.setEnabled(true) |
This file contains hidden or 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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
Log.d(TAG, "Weather Station Started"); | |
try { | |
mDisplay = RainbowHat.openDisplay(); | |
mDisplay.setEnabled(true); | |
mDisplay.display("OK "); |