Skip to content

Instantly share code, notes, and snippets.

View thomassnielsen's full-sized avatar

Thomas Sunde Nielsen thomassnielsen

  • Carrot
  • Bergen
View GitHub Profile
@thomassnielsen
thomassnielsen / controllers.application.js
Created May 14, 2018 12:55 — forked from czosel/controllers.application.js
ember-validated-form basic example
import Ember from 'ember';
import UserValidations from 'twiddle/validations/user';
export default Ember.Controller.extend({
UserValidations,
actions: {
submit(model) {
console.log('submit', model)
model.save()
import UIKit
extension UIViewController {
@IBAction func dismiss(sender: AnyObject?) {
if let nc = self.navigationController {
nc.popViewControllerAnimated(true)
} else {
self.dismissViewControllerAnimated(true, completion: nil)
}
}
@thomassnielsen
thomassnielsen / example.swift
Created November 2, 2014 12:48
Loadingbar component for WKWebView
import UIKit
import WebKit
import LoadingBarKit
class ViewController: UIViewController {
@IBOutlet var loadingBar: LoadingBar!
var webView: WKWebView?
override func viewDidLoad() {
super.viewDidLoad()
self.webView?.addObserver(self, forKeyPath: "estimatedProgress", options: NSKeyValueObservingOptions.New, context: nil)
@thomassnielsen
thomassnielsen / gist:8194807
Created December 31, 2013 10:01
Obj-clean bug: Line 61 gets an error needing an empty row below, even though 62 is empty. Probably because of the comment below.
//
// PAMFeedTableViewController.m
// OneStreet
//
// Created by Thomas Sunde Nielsen on 20.12.13.
// Copyright (c) 2013 PAM. All rights reserved.
//
#import "PAMFeedTableViewController.h"