Skip to content

Instantly share code, notes, and snippets.

Avatar
🌱
Developing a new macOS app.

Eivind Lindbråten eivindml

🌱
Developing a new macOS app.
View GitHub Profile
View subscription.js
const [suggestions, setSuggestions] = useState([])
useEffect(() => {
const query = `*[_type == "suggestion"] {
content, _id, category,
author->{"avatarUrl": image.asset->url, name, _id},
likes[]->{_id, image{..., asset->}},
comments, replied
}`
const subscription = API.listen(query, {}, {events: ['welcome', 'mutation']})
.subscribe(item => {
@eivindml
eivindml / scntool.md
Created Nov 12, 2018 — forked from matux/scntool.md
SceneKit scntool command line options
View scntool.md
$ xcrun scntool --verbose
| Current SceneKit version is 4.560000
| Running scntool (compiled on Jul  1 2018 01:01:55)

usage: scntool --convert file --format format [--output file]
000084a8: 7363 7269 7074 696f 6e00 2d2d 7461 7267 6574 2d70 6c61 7466 :scription.--target-platf
View MenuButtonsViewController.swift
private extension MenuButtonsViewController {
// TODO: Find a way to find correct button based on MenuItem
func buttonFor(for menuItem: MenuItem) -> EmojiButton? {
guard let subViews = stackView.subviews as? [EmojiButton] else {
return nil
}
let button = buttonFactory.makeEmojiButton(title: menuItem.icon)
for subView in subViews where subView == button {
return subView
}
View HabitsView.swift
import UIKit
protocol HabitsViewDelegate: class {
func habitsView(_ habitsView: HabitsView, didSelectAddButton button: UIButton)
}
class HabitsView: UIView {
weak var delegate: HabitsViewDelegate?
View RadioAlarm.applescript
tell application "iTunes"
set the sound volume to 50 -- Sett volume
set selected of AirPlay device "🐼 TV" to true -- Velg AirPlay device
open location "http://lyd.nrk.no/nrk_radio_p3_mp3_h" -- Putt inn egen radio URL
end tell
View CustomSegue.swift
//
// ModalSegue.swift
// HabitTracker
//
// Created by Eivind Lindbråten on 03.09.2017.
// Copyright © 2017 Eivind Lindbråten. All rights reserved.
//
import UIKit
@eivindml
eivindml / mailsend-on-macos.md
Created Aug 30, 2017
How to configure postfix mail on macOS, using Gmail.
View mailsend-on-macos.md

Instructions

Set gmail username and password.

sudo vi /etc/postfix/sasl_passwd

Enter username and password using the following format: [smtp.gmail.com]:587 EMAIL@gmail.com:PASSWORD

@eivindml
eivindml / grid.sass
Created May 14, 2017
Minimalist CSS grid, using new CSS grid property. 🏁 Check compatibility before use.
View grid.sass
.l-wrap
width: 100%
max-width: 1196px
margin: 0 auto
.l-grid
display: grid
grid-gap: 52px
grid-template-columns: repeat(6, 1fr)