Skip to content

Instantly share code, notes, and snippets.

@SidShetye
SidShetye / StripeWebhookController.cs
Created October 25, 2012 04:36
Receiving Stripe.com's Webhooks in ASP.NET C#, MVC4
using System;
using System.IO;
using System.Web;
using System.Web.Mvc;
using Stripe; // you need this library https://github.com/jaymedavis/stripe.net
using System.Net;
namespace StripeSampleMVC.Controllers
{
public class StripeWebhookController : Controller
@tystol
tystol / CascadeDeleteAttribute.cs
Last active October 26, 2022 21:55
Entity Framework CascadeDelete using Data Annotations
using System;
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class CascadeDeleteAttribute : Attribute { }
@phatblat
phatblat / AppDelegate.swift
Last active May 4, 2024 12:34
Example of creating HKObserverQuery and enabling background delivery for multiple HKObjectType
@UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {
let healthKitManager = HealthKitManager()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if onboardingComplete {
healthKitManager.requestAccessWithCompletion() { success, error in
if success { print("HealthKit access granted") }
else { print("Error requesting access to HealthKit: \(error)") }
}
@manishtiwari25
manishtiwari25 / country_state.json
Last active June 1, 2024 00:07
List Of Countries With States And Other Useful Information, Updated On 06/01/2024 00:07:09
[
{
"name": "Andorra",
"countryCode": "AD",
"countryCodeAlpha3": "AND",
"phone": "376",
"currency": "EUR",
"flag": "http://img.geonames.org/flags/x/ad.gif",
"symbol": "\u20AC",
"stateProvinces": [
@manishtiwari25
manishtiwari25 / world_currency_symbols.json
Last active June 1, 2024 00:08
List Of Countries With States And Other Useful Information, Updated On 06/01/2024 00:08:04
[
{
"Flag": "http://img.geonames.org/flags/x/ad.gif",
"CountryName": "Andorra",
"Currency": "Euro Member Countries",
"Code": "EUR",
"Symbol": "\u20AC",
"SymbolImage": "https://www.xe.com/symbols-page/symbols/curSymbol8364.gif"
},
{