Skip to content

Instantly share code, notes, and snippets.

View nside's full-sized avatar

Denis Laprise nside

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nside
nside / main.mm
Created September 9, 2021 15:36
SDL2 RevenueCat integration
// You can use this in your main.mm
#import "../SDL/include/SDL_uikitappdelegate.h"
#import <Purchases/Purchases.h>
@interface MyDelegate : SDLUIKitDelegate
@end
@implementation MyDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
@nside
nside / main.mm
Created September 8, 2021 17:56
Override application delegate on iOS with SDL2
// You can use this in your main.mm
#import "../SDL/include/SDL_uikitappdelegate.h"
@interface MyDelegate : SDLUIKitDelegate
@end
@implementation MyDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nside
nside / graphhopper.rs
Created April 21, 2021 05:27
Graphhopper route client for Rust (uses reqwest)
pub type Point = [f64;3];
#[derive(Default, Debug, Clone, PartialEq, serde_derive::Serialize, serde_derive::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RouteResponse {
pub hints: Hints,
pub info: Info,
pub paths: Vec<Path>,
}
@nside
nside / test.md
Last active October 31, 2018 03:47

Alt text

{
"type": "Feature",
"properties": {
"name": "Coors Field",
"amenity": "Baseball Stadium",
"popupContent": "This is where the Rockies play!"
},
"geometry": {"type":"Polygon","coordinates":[[[-74.3660367388635,39.40413],[-74.3661057823687,39.4035883356439],[-74.366310259581,39.4030674831777],[-74.3666423125559,39.4025874593515],[-74.3670891806838,39.4021667122319],[-74.3676336910731,39.4018214120983],[-74.3682549184949,39.4015648298447],[-74.3689289895278,39.4014068268035],[-74.36963,39.4013534756247],[-74.3703310104722,39.4014068268035],[-74.3710050815051,39.4015648298447],[-74.3716263089269,39.4018214120983],[-74.3721708193162,39.4021667122319],[-74.372617687444,39.4025874593515],[-74.372949740419,39.4030674831777],[-74.3731542176313,39.4035883356439],[-74.3732232611365,39.40413],[-74.3731542176313,39.4046716601493],[-74.372949740419,39.4051925006353],[-74.372617687444,39.405672506532],[-74.3721708193162,39.4060932325023],[-74.3716263089269,39.4064385114866],[-74.37100
{u'Location': {u'TelephoneNumber': {u'FunctionalTypeDescription': u'Main', u'PhoneNumber': u'(708) 731-2702'}, u'Name': u'D145 Dist Ofc', u'LocationMilestones': {u'OpenDate': u'2004-02-01T12:00:00'}, u'TypeCode': u'RGD', u'@locale': u'en-US', u'SubTypeDescription': u'District Office', u'TimeZone': {u'TimeZoneCode': u'CST', u'TimeZoneOffset': {u'OffsetCode': u'UTC', u'OffsetHours': u'-06'}, u'TimeZoneDescription': u'Central Std Time'}, u'AlternateIdentifier': {u'TypeDescription': u'Legal Store Number', u'ID': u'T3912'}, u'Address': {u'City': u'Broadview', u'Subdivision': u'IL', u'Longitude': -87.851863, u'County': u'Cook', u'PostalCode': u'60155-4887', u'FormattedAddress': u'800 Broadview Village Sq, Broadview, IL 60155-4887', u'AddressLine1': u'800 Broadview Village Sq', u'Latitude': 41.853146, u'CountryName': u'United States', u'IntersectionDescription': u'NEQ Calumet Ave & BroadmoorAve'}, u'TypeDescription': u'Rgd (region/group/district office)', u'ID': 3912, u'IsDaylightSavingsTimeRecognized': u'true'}}
@nside
nside / pexecute.py
Created January 13, 2015 01:06
reads commands to run on stdin and runs them simultaneously
import multiprocessing, sys, os, fileinput
p = multiprocessing.Pool(4)
p.map(os.system, sys.stdin.readlines())