Skip to content

Instantly share code, notes, and snippets.

Working from home

Eduardo Chiaro eduardochiaro

Working from home
View GitHub Profile
eduardochiaro / AppDelegate.swift
Created Jul 3, 2017
Xcode 8.3, Swift 3.1 - Using common SQLite database as persistent container.
View AppDelegate.swift
lazy var persistentContainer: NSPersistentContainer = {
let sqlitePath = Bundle.main.url(forResource: "DATABASE_NAME", withExtension: "sqlite")
if FileManager.default.fileExists(atPath: sqlitePath!.path) {
let container = NSPersistentContainer(name: "DATABASE_NAME")
let description = NSPersistentStoreDescription(url: sqlitePath!)
description.shouldInferMappingModelAutomatically = true
View designer.html
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<polymer-element name="my-element">
eduardochiaro / gist:1885745
Created Feb 22, 2012
Google's Wave Doodle
View gist:1885745
@keyframes wave
0% {background-position: 0px 0px}
100% {background-position: -388px 0px}
@-moz-keyframes wave /* Firefox */
0% {background-position: 0px 0px}
100% {background-position: -388px 0px}
eduardochiaro / gist:1789380
Created Feb 10, 2012
Activate new Google bar
View gist:1789380
document.cookie="PREF=ID=03fd476a699d6487:U=88e8716486ff1e5d:FF=0:LD=en:CR=2:TM=1322688084:LM=1322688085:S=McEsyvcXKMiVfGds; path=/;";window.location.reload();
You can’t perform that action at this time.