Skip to content

Instantly share code, notes, and snippets.

View chan-han's full-sized avatar
💭
It only works on my MacBook

CHAN-HAN chan-han

💭
It only works on my MacBook
  • DataCredit
  • korea
View GitHub Profile
@Amzd
Amzd / StateObject.swift
Last active October 7, 2024 22:25
StateObject that works in iOS 13
import Combine
import PublishedObject // https://github.com/Amzd/PublishedObject
import SwiftUI
/// A property wrapper type that instantiates an observable object.
@propertyWrapper
public struct StateObject<ObjectType: ObservableObject>: DynamicProperty
where ObjectType.ObjectWillChangePublisher == ObservableObjectPublisher {
/// Wrapper that helps with initialising without actually having an ObservableObject yet
@nathanjohnson320
nathanjohnson320 / gist:7283784
Last active February 2, 2021 10:35
Use the Google Places API with node.js
exports.randeats = function(req, res){
var key = req.query.key;
var location = encodeURIComponent(req.query.location);
var radius = 16000;
var sensor = false;
var types = "restaurant";
var keyword = "fast";
var https = require('https');
var url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?" + "key=" + key + "&location=" + location + "&radius=" + radius + "&sensor=" + sensor + "&types=" + types + "&keyword=" + keyword;