Skip to content

Instantly share code, notes, and snippets.

View harmancode's full-sized avatar
🐜
Mostly on GitLab. Dreaming on having time for indie projects.

E. Harman harmancode

🐜
Mostly on GitLab. Dreaming on having time for indie projects.
View GitHub Profile
@mandiwise
mandiwise / Sync gh-pages + master branches
Last active September 28, 2024 09:43
Keep gh-pages up to date with a master branch
// Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/
$ git add .
$ git status // to see what changes are going to be commited
$ git commit -m 'Some descriptive commit message'
$ git push origin master
$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push origin gh-pages // commit the changes
@daniel-234
daniel-234 / BackboneJS API fetch and parse
Last active March 8, 2022 18:23
BackboneJS - Fetch data from an API and parse the response populating models inside a collection
About this gist
With this gist I wanted to freeze some concepts about BackboneJS that could
save some time in the future either to me if I needed to use this functionality
again, or to somebody else.
This implementation addresses the need to retrieve some data from an API and
to populate a BackboneJS collection accordingly, storing the retrieved items
as Models inside the Collection.
If you want to see this functionality built into an application, have a look
@ole
ole / core-data-backup.swift
Last active January 1, 2024 16:52
How to make a copy of a Core Data SQLite database. See https://oleb.net/blog/2018/03/core-data-sqlite-backup/ for more.
import CoreData
import Foundation
/// Safely copies the specified `NSPersistentStore` to a temporary file.
/// Useful for backups.
///
/// - Parameter index: The index of the persistent store in the coordinator's
/// `persistentStores` array. Passing an index that doesn't exist will trap.
///
/// - Returns: The URL of the backup file, wrapped in a TemporaryFile instance
@atomicbird
atomicbird / NSPersistentContainer+extension.swift
Created May 22, 2020 21:39
Back up and restore Core Data persistent stores
//
// NSPersistentContainer+extension.swift
// CDMoveDemo
//
// Created by Tom Harrington on 5/12/20.
// Copyright © 2020 Atomic Bird LLC. All rights reserved.
//
import Foundation
import CoreData