A stored procedure that saves (insert/update) a URL, then returns the id for the record.
Works in Go v1.11.6+
and MySQL 5.7+
.
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE SaveUrl(
IN p_url varchar(8200),
IN p_title text
/// Represents parts of time | |
struct TimeParts: CustomStringConvertible { | |
var seconds = 0 | |
var minutes = 0 | |
/// The string representation of the time parts (ex: 07:37) | |
var description: String { | |
return NSString(format: "%02d:%02d", minutes, seconds) as String | |
} | |
} |
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE html> | |
<html xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' | |
xmlns:expr='http://www.google.com/2005/gml/expr'> | |
<head> | |
<meta charset='utf-8' /> | |
<meta content='IE=edge' http-equiv='X-UA-Compatible' /> | |
<meta content='width=device-width, initial-scale=1' name='viewport' /> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> |
// | |
// DispatchQueueDelay.swift | |
// | |
// Created by C. Bess on 9/17/19. | |
// MIT - Soli Deo gloria - perfectGod.com | |
// | |
// refs: | |
// - https://gist.github.com/fjcaetano/ff3e994c4edb4991ab8280f34994beb4 | |
// - https://www.craftappco.com/blog/2018/5/30/simple-throttling-in-swift |
def update_model(model, save_update=True, **kwargs): | |
"""Updates the specified model instance using the keyword arguments as the model | |
property attributes and values. | |
Example usage: | |
update_model(mymodel, save_update=True, **some_dictionary) | |
""" | |
for attr, val in kwargs.items(): | |
setattr(model, attr, val) |
A stored procedure that saves (insert/update) a URL, then returns the id for the record.
Works in Go v1.11.6+
and MySQL 5.7+
.
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE SaveUrl(
IN p_url varchar(8200),
IN p_title text
import Foundation | |
/// Represents the Log facilities | |
struct Log { | |
/// Prints in debug only | |
static func debug(_ msg: String, line: Int = #line, fileName: String = #file, funcName: String = #function) { | |
#if DEBUG | |
let fname = (fileName as NSString).lastPathComponent | |
print("[\(fname) \(funcName):\(line)]", msg) | |
#endif |
package uploader | |
import ( | |
"bytes" | |
"compress/gzip" | |
"myapp/internal/config" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/s3/s3manager" |
# the server provisioning module | |
# uses: python-digitalocean==1.16.0 | |
# ref: https://developers.digitalocean.com/documentation/v2/#droplets | |
import digitalocean | |
import os | |
class ProvisionServerException(Exception): | |
pass |
// Sets the view's background to the given image | |
// prior to call, you may need to execute: `view.wantsLayer = YES` | |
void SetBackgroundImage(NSView *view, NSString *imageName) | |
{ | |
view.layer.contents = (id)[NSImage imageNamed:imageName]; | |
} |
<key>Customized</key> | |
<dict> | |
<key>Delete Line</key> | |
<string>selectLine:, deleteBackward:</string> | |
<key>Duplicate Lines</key> | |
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string> | |
<key>Duplicate Current Line</key> | |
<string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string> | |
</dict> |