- You can store a price in a floating point variable.
- All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
- All currencies are subdivided in decimal units (like dinar/fils)
- All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
- All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
- Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
- For any currency you can have a price of 1. (ZWL)
- Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
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
| #!/bin/bash | |
| # | |
| # Watch current directory (recursively) for file changes, and execute | |
| # a command when a file or directory is created, modified or deleted. | |
| # | |
| # Written by: Senko Rasic <[email protected]> | |
| # | |
| # Requires Linux, bash and inotifywait (from inotify-tools package). | |
| # | |
| # To avoid executing the command multiple times when a sequence of |
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
| // Put your file to "YOUR_UNITY_PROJ/Assets/StreamingAssets" | |
| // example: "YOUR_UNITY_PROJ/Assets/StreamingAssets/db.bytes" | |
| string dbPath = ""; | |
| if (Application.platform == RuntimePlatform.Android) | |
| { | |
| // Android | |
| string oriPath = System.IO.Path.Combine(Application.streamingAssetsPath, "db.bytes"); | |
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
| # Logstash config for Glassfish logs | |
| # Used in combination with slf4j and logback | |
| # Output: | |
| # - application: glassfish | |
| # - type: application or internal | |
| # - categorie: technical or functional | |
| input { | |
| # If running logstash under a different user then check your permission to be sure that |
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
| "use strict"; | |
| var test = '<b style="color:#fff; background: red">He<i>ll</i>o </b><u>Wo<i>rld</i></u>'; | |
| function parseStyle(text){ | |
| // Patterns and temp strings | |
| var tags_rx = /<\s*(\/?\s*[^>]+)(\s+[^>]+)?\s*>/gm, | |
| css_rx = /([\w-]+\s*:\s*[^\n;"']+)/gm, | |
| partial, tag, css, temp_style; | |
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
| brew_cask_install() { | |
| if ! brew_cask_is_installed "$1"; then | |
| brew cask install "$@" | |
| fi | |
| } | |
| brew_cask_is_installed() { | |
| local NAME=$(brew_cask_expand_alias "$1") | |
| brew cask list -1 | grep -Fqx "$NAME" | |
| } |
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
| // AppDelegate.swift | |
| import UIKit | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| var activeCornerRadius : Int = 6 | |
| var incativeCornerRadius : Int = 0 |
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 Leap = require('leapjs'); | |
| var XboxController = require('xbox-controller'); | |
| var xbox = new XboxController; | |
| Leap.loop(function (frame) { | |
| if (frame.hands.length === 0) { | |
| xbox.rumble(0, 0); | |
| return; | |
| } | |
| frame.hands.forEach(function(hand) { |
Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.
After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.