Skip to content

Instantly share code, notes, and snippets.

@nkalvi
nkalvi / NavigationSplitViewExample.swift
Last active November 7, 2024 01:49 — forked from Dimillian/NavigationSplitViewExample.swift
An example on how to use the new NavigationSplitView on iPad with global navigation - updated to work by following "Bringing robust navigation structure to your SwiftUI app"
// 2024-11-06: Simple test based on "Bringing robust navigation structure to your SwiftUI app"
// https://developer.apple.com/documentation/swiftui/bringing_robust_navigation_structure_to_your_swiftui_app
// Xcode Version 16.1, iOS 17+
// Opens to a sheet first instead of NavigationSplitView
import SwiftUI
@main
struct TestSplitViewApp: App {
@wowkin2
wowkin2 / Readme.md
Last active September 26, 2024 09:28
Solution: "Exceeded 4 calls per second for api client" Python Shopify API - shopify_python_api

Solution for API call limit "shopify_python_api"

If you are using Python Shopify API and getting following error
"Exceeded 4 calls per second for api client. Reduce request rates to resume uninterrupted service."
but want your script to continue working with some timeout after that,
you can use following script from shopify_limits_patch.py.

For that just copy shopify_limits_patch.py to your project and import shopify_limits_patch.

Or if you want to call it implicitly import it, remove last line patch_shopify_with_limits()
and call it before all your shopify calls.

@develmaycare
develmaycare / duplicate-row.js
Last active December 8, 2024 09:46
Duplicate a row in Google Sheets.
/* To use this in a Google Sheet:
1. Go to Tools > Script Editor.
2. Save the script.
3. Paste this script and click on the bug symbol.
4. Authorize the script.
5. Refresh the sheet.
*/
// global
var ss = SpreadsheetApp.getActive();
@PatrickJS
PatrickJS / factory-shared.es5.js
Last active May 17, 2024 03:37
Different examples of OOP "class" with "inheritance" done using JavaScript including languages that transpile into js. Take notice to the amount of boilerplate that's needed in ES5 compared to ES6. These examples all have the same interface with pros/cons for each pattern. If they seem similar that's whole point especially the difference between…
var EventEmitter = require('events').EventEmitter;
var _ = require('lodash');
// Factory shared
var makePerson = function() {
var person = {};
EventEmitter.call(person);
person.wallet = 0;
_.extend(person, personMethods)
return person;
@robschmuecker
robschmuecker / README.md
Last active March 14, 2026 05:59
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@kjordahl
kjordahl / onewire.pde
Created June 1, 2011 16:48
Arduino sketch to read data from DS18x20 digital temperature sensors
/* Name: onewire.pde
Read data from multiple DS18x20 digital temperature sensors
DS18B20 <http://www.maxim-ic.com/datasheet/index.mvp/id/2812>
DS18S20 <http://www.maxim-ic.com/datasheet/index.mvp/id/2815>
* Detect number and type of sensors, and whether each is using parasitic power
* Gracefully handles plugging/unplugging of sensors (but will not
detect new sensors after initialization)