Skip to content

Instantly share code, notes, and snippets.

#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@tonisuter
tonisuter / dabblet.css
Created March 15, 2012 06:59
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #dddddd;
min-height: 100%;
@tonisuter
tonisuter / dabblet.css
Created March 15, 2012 06:59
Inset Box
/**
* Inset Box
*/
html {
background: white;
min-height:100%;
}
.inset_box {
@tonisuter
tonisuter / dabblet.css
Created May 24, 2012 07:42
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html {
font-family:verdana;
background-color:#232323;
}
ul {
list-style:none;
let maxMagnitude = 4000.0
let magnitudeRatio = magnitude / maxMagnitude
strengthIndicator.progress = Float(magnitudeRatio)
@IBAction func captureImageWithQRCode(_ sender: UIButton) {
let solutionLogger = SolutionLogger(viewController: self)
solutionLogger.scanQRCodeAndCaptureImage { (qrCode: String, image: UIImage) in
// use qrCode and image
}
}
let fetchRequest: NSFetchRequest<MemoryPair> = MemoryPair.fetchRequest()
fetchRequest.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)]
do {
let pairs: [MemoryPair] = try coreDataStack.context.fetch(fetchRequest)
// display the memory pairs
} catch {
print(error)
}
let memoryPair = MemoryPair(context: coreDataStack.context)
memoryPair.creationDate = Date()
memoryPair.image1 = image1
memoryPair.text1 = code1
memoryPair.image2 = image2
memoryPair.text2 = code2
coreDataStack.saveContext()
coreDataStack.context.delete(memoryPair)
coreDataStack.saveContext()
@tonisuter
tonisuter / main.swift
Last active July 10, 2017 02:26
Testing libSwiftPM
import Basic
import PackageGraph
import PackageLoading
import Workspace
class MyWorkspaceDelegate: WorkspaceDelegate {
func packageGraphWillLoad(currentGraph: PackageGraph, dependencies: AnySequence<ManagedDependency>, missingURLs: Set<String>) {
print("packageGraphWillLoad")
}