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
var btcConst = 100000000; | |
var mbtcConst = 100000; | |
var v = 100000; // Satoshi Received | |
var mbtc = v / mbtcConst; | |
var btc = v / btcConst; | |
console.log(mbtc.toString()); | |
console.log(btc.toString()); |
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 | |
class AlertClass: NSObject { | |
func ShowAlertBox(title : NSString, msg : NSString) { | |
var alertMsg = UIAlertView(title: title, message: msg, delegate: nil, cancelButtonTitle: "Dismiss") | |
alertMsg.show() | |
} | |
} |
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 CoreData | |
class SampleClass : NSManagedObject { | |
@NSManaged var name : NSString | |
@NSManaged var description : NSString | |
@NSManaged var trueFalseFlag : NSNumber | |
@NSManaged var location : AnyObject | |
} |
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
# Find out what you want to encrypt (maybe even pipe a file into it) | |
echo -n "Some text to encrypt" | openssl enc -e -aes-256-cbc -a -salt | |
# Then choose a password | |
# To decrypt (will need the password you used to ecnrypt) | |
# You can also pipe in a file which should return the original document | |
echo "encrypted string" | openssl enc -d -aes-256-cbc -a -salt | |
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
require "base64"; s = File.new("Somefilename", "rb"); contents = s.read; puts Base64.encode64(contents); |
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
class Test | |
def 你好 | |
puts "Hello" | |
end | |
def привет | |
puts "Hello" | |
end | |
def 😊 |
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
<div style="background-image: url('https://url.goes.here'); height: 225px; width: 300px; position: relative;"></div> | |
<p><sup>above: Linking</sup></p> |
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
var hdict : Dictionary<String,String> = ["Key": "Val"] | |
for (key: String, value: String) in hdict { | |
println("\(key) = \(value)") | |
} |
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
func escape(string: String) -> String { | |
let generalDelimiters = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 | |
let subDelimiters = "!$&'()*+,;=" | |
let legalURLCharactersToBeEscaped: CFStringRef = generalDelimiters + subDelimiters | |
return CFURLCreateStringByAddingPercentEscapes(nil, string, nil, legalURLCharactersToBeEscaped, CFStringBuiltInEncodings.UTF8.rawValue) as String | |
} | |
println(escape(phnumber)) |
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
require "openssl" | |
require "base64" | |
def sign(key, str) | |
ssl_sign = OpenSSL::HMAC.digest("sha512", key, str) | |
return Base64.encode64(ssl_sign).to_s.gsub("\n","") | |
end |
OlderNewer