This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
import SwiftUI | |
fileprivate extension DateFormatter { | |
static var month: DateFormatter { | |
let formatter = DateFormatter() | |
formatter.dateFormat = "MMMM" | |
return formatter | |
} | |
static var monthAndYear: DateFormatter { |
import Foundation | |
// Source: https://stackoverflow.com/a/39425959 | |
extension Character { | |
/// A simple emoji is one scalar and presented to the user as an Emoji | |
var isSimpleEmoji: Bool { | |
guard let firstScalar = unicodeScalars.first else { return false } | |
return firstScalar.properties.isEmoji && firstScalar.value > 0x238C | |
} |
# File: app/controllers/api/api_controller.rb | |
class Api::ApiController < ActionController::Base | |
# Consider subclassing ActionController::API instead of Base, see | |
# http://api.rubyonrails.org/classes/ActionController/API.html | |
protect_from_forgery with: :null_session | |
before_action :authenticate | |
def self.disable_turbolinks_cookies | |
skip_before_action :set_request_method_cookie |
export function clapperBoard() { | |
let audio = new AudioContext() | |
let beep = audio.createOscillator() | |
let flash = document.createElement("div") | |
beep.frequency.value = 440 * 5 | |
beep.connect(audio.destination) | |
flash.classList.add("clapperboard") | |
beep.start() |
I suspect most developers are using the libdispatch inefficiently due to the way it was presented to us at the time it was introduced and for many years after that, and due to the confusing documentation and API. I realized this after reading the 'concurrency' discussion on the swift-evolution mailing-list, in particular the messages from Pierre Habouzit (who is the libdispatch maintainer at Apple) are quite enlightening (and you can also find many tweets from him on the subject).
My take-aways are:
The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.
First the simplest/core layers, then optional layers depending on which features/functionality you want.
Specs |
|
---|---|
AUTHOR | Ira Herman |
LANGUAGE/STACK | Ruby on Rails Version 4 or 5 |
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) | |
{ | |
NSRunLoop * runLoop; | |
CLIMain * main; // replace with desired class | |
@autoreleasepool | |
{ | |
// create run loop |
#import <Foundation/Foundation.h> | |
@interface SafeSet : NSObject { | |
NSMutableSet *set; | |
dispatch_queue_t queue; | |
} | |
@end | |
@implementation SafeSet |
/* | |
Copyright (C) 2016 Apple Inc. All Rights Reserved. | |
See LICENSE.txt for this sample’s licensing information | |
Abstract: | |
`DirectoryMonitor` is used to monitor the contents of the provided directory by using a GCD dispatch source. | |
*/ | |
import Foundation |