let parameters = [
"customer": ["id": "1459504", "email": "steve@interactivelabs.co"],
"campaign": ["id": 14190]
]
loadingView.startLoading()
Client.request(.POST, "/referral_codes", parameters) {(result, error) in
if let result = result {
let userDefaults = NSUserDefaults.standardUserDefaults()
if let referralCode = result["referral_code"] as? String {
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
{ | |
"event": { | |
"event_type": "signature_request_viewed", | |
"event_time": "1562151155", | |
"event_hash": "0fa0674d805a5c097d00a30b9d594f24b4e578a56fb372a7111cf34afaa9aaf2", | |
"event_metadata": { | |
"related_signature_id": "ab61c835f738ccaf8e2e10f85b241264", | |
"reported_for_account_id": "5aacd6442d98dde98bb76b82bf6fa3f73c87451d", | |
"reported_for_app_id": null | |
} |
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
#!/usr/bin/env python2 | |
# coding=utf-8 | |
import json | |
import logging | |
import time | |
import select | |
import paramiko | |
import random | |
from aliyunsdkcore.client import AcsClient |
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
#!/usr/bin/env python2 | |
import sys | |
import time | |
import thread | |
import struct | |
from Quartz.CoreGraphics import * | |
kVK_ANSI_1 = int('12', 16) | |
kVK_ANSI_2 = int('13', 16) |
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
o = range(100) | |
def atob(i): | |
if i < pattern[0]: | |
return i | |
c, m = divmod(i - pattern[0], pattern[1]) | |
if m >= 0: | |
c += 1 | |
c = min(len(x), c) | |
return i + c |
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
geolib = require 'geolib' | |
sf_94118 = latitude: 37.789018, longitude: -122.391506 | |
places = [ | |
{name: 'Bayview Parents', latitude: 37.7304153, longitude: -122.3844223}, | |
{name: 'Bernal Heights Parents', latitude: 37.7485809, longitude: -122.4184113}, | |
{name: 'Cole Valley Parents', latitude: 37.7717171, longitude: -122.4438934}, | |
{name: 'Excelsior_Parents', latitude: 37.7225494, longitude: -122.4410629}, | |
{name: 'Glen Park Parents (old group)', latitude: 37.7401047, longitude: -122.4382324}, |
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
using System; | |
using System.Collections.Generic; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Net; | |
using System.Linq; | |
public class PublishAmazonSnsMsg | |
{ |
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
tell application "iPhoto" | |
set curPhotos to selection | |
repeat with thisPhoto in curPhotos | |
set thisDate to (date of thisPhoto) | |
set hours to (thisDate's hours) - 15 | |
if hours < 0 then | |
set hours to hours + 24 | |
set thisDate's day to (thisDate's day) - 1 | |
end if |
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
sameBirthdayPossibility = (N) -> | |
x = 1 | |
[0...N].forEach (n) -> x *= 1 - n / 365 | |
1 - x | |
console.log sameBirthdayPossibility 43 |
Most of these guidelines are to match Apple's documentation and community-accepted best practices. Some are derived some personal preference. This document aims to set a standard way of doing things so everyone can do things the same way. If there is something you are not particularly fond of, it is encouraged to do it anyway to be consistent with everyone else.
This document is mainly targeted toward iOS development, but definitely applies to Mac as well.
NSString *foo = @"bar";
NewerOlder