Skip to content

Instantly share code, notes, and snippets.

View zackshapiro's full-sized avatar

Zack Shapiro zackshapiro

View GitHub Profile
var port = process.env.PORT || 1337;
var httpServer = require('http').createServer(app);
const https = require('https');
httpServer.listen(port, function() {
console.log('parse-server-example running on port ' + port + '.');
});
// new
var options = {
@zackshapiro
zackshapiro / universal_blocks.json
Last active April 4, 2018 21:57
Universal Blocks Documentation
For all of these, can `balance` also be a RAW value?
Send blocks
{
"type": "utx",
"account": "xrb_from_address",
"previous": "previous_block_hash",
"representative": "xrb_your_current_or_new_rep",
"balance": "as_raw_or_hex",
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: "LogOut"), object: nil, queue: nil) { _ in
UserService.logOut()
Answers.logCustomEvent(withName: "User Logged Out")
DispatchQueue.main.async {
self.navigationController?.setViewControllers([WelcomeViewController()], animated: false)
self.navigationController?.dismiss(animated: true, completion: nil)
}
@zackshapiro
zackshapiro / SendTextField.swift
Last active February 27, 2018 22:10
SendVC.swift
import UIKit
final class SendTextField: UITextField {
init() {
super.init(frame: .zero)
backgroundColor = .clear
textColor = .white
tintColor = .white
@zackshapiro
zackshapiro / UInt256.swift
Created December 4, 2017 21:00
An implementation of UInt256 based off of https://github.com/Jitsusama/UInt128
//
// UInt256.swift
// Raiblocks
//
// Created by Zack Shapiro on 12/4/17.
// Copyright © 2017 Zack Shapiro. All rights reserved.
//
// MARK: Error Type
Verifying my Blockstack ID is secured with the address 1AVBTaTGz5Feuv8vwMevHnS8WLdLkmb99M https://explorer.blockstack.org/address/1AVBTaTGz5Feuv8vwMevHnS8WLdLkmb99M
{
"0": {
"id": 4,
"title": "NYU Law 5",
"description": "baz dev",
"createdAt": "2017-06-15T15:43:39.381Z",
"updatedAt": "2017-08-11T20:46:11.890Z",
"userId": 5,
"opacity": 1,
"glow": 0.5,
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: {
app: ['webpack/hot/dev-server', './scripts/app.js']
},
output: {
filename: 'bundle.js',
extension UIColor {
class func fromRGB(rgb: UInt32) -> UIColor {
return UIColor(
red: CGFloat((rgb & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgb & 0x00FF00) >> 8) / 255.0,
blue: CGFloat(rgb & 0x0000FF) / 255.0,
alpha: CGFloat(1.0)
)
}
Exporting IPA from generated Archive...
$ xcodebuild -exportArchive -archivePath "/var/folders/lb/8n5bn9k975qgw662jpqdy7mm0000gn/T/bitrise-xcarchive.4TOLTkLl/storefront.xcarchive" -exportPath "/var/folders/lb/8n5bn9k975qgw662jpqdy7mm0000gn/T/bitrise-xcarchive.sUfa0bhn" -exportOptionsPlist "/Users/vagrant/deploy/export_options.plist"
2016-04-26 07:51:02.436 xcodebuild[2341:8637] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/lb/8n5bn9k975qgw662jpqdy7mm0000gn/T/storefront_2016-04-26_07-51-02.434.xcdistributionlogs'.
2016-04-26 07:51:02.666 xcodebuild[2341:8637] [MT] DeveloperPortal: Using store at URL (file:///Users/vagrant/Library/Developer/Xcode/DeveloperPortal%207.3.db).
2016-04-26 07:51:03.487 xcodebuild[2341:8637] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7ff5724d3330>: Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomai