Skip to content

Instantly share code, notes, and snippets.

Avatar

Morten Just mortenjust

View GitHub Profile
View AR glasses
Company: Apple
Product: Apple AR Glasses
Short emotional tagline: The future is closer than it appears
Script:
In our lifetimes we’ve seen technology change our lives
In ways we couldn’t imagine
In the past decade alone, it’s become an extension of who we are
So when we talk about the future
We don’t just mean flying cars and robots
We mean a future where we’re not tethered to our screens
View Danish ad
Company: Danske Bank
Product: Vi låner penge ud til folk og tager renter
Short emotional tagline: Får du en god idé?
Script:
Hvad gør du, når du får en god idé?
Har du modet til at tro på den og gøre noget ved den?
Er du bange for, at andre vil tage din idé og gøre den bedre?
Eller er du bare bange for at tabe?
Så hvad gør du?
Siger du fra og sætter en stopper for din drøm?
View gist:cbae4bb40a558752c2ead7a874635e0d
The following are tv commercials in the style of a highly emotional lifestyle branding campaign from Nike. They are inspirational and upbeat. Feel something. Dream bigger. The script contains 11 short lines.
Company: Nike
Product: Shoes
Short emotional tagline: Never too far down
Script:
We've all been underestimated and counted out
In those moments we felt like it was over
But it's when we're given no chance
that we somehow found that last bit of strength to keep fighting
View gist:8ab8eb3774a02ac27c7cefc0af5c5244
let task = Process()
var args = [String]()
args.append("-c")
let bundle = Bundle.main.bundlePath
args.append("sleep 0.2; open \"\(bundle)\"")
task.launchPath = "/bin/sh"
task.arguments = args
task.launch()
NSApplication.shared().terminate(nil)
View detect 12 or 24 hour.swift
func usesAMPM() -> Bool {
let locale = NSLocale.currentLocale()
let dateFormat = NSDateFormatter.dateFormatFromTemplate("j", options: 0, locale: locale)!
if dateFormat.rangeOfString("a") != nil {
return true
}
else {
return false
}
}
@mortenjust
mortenjust / obb+.sh
Created Jan 22, 2016
install obb on all connected devices, requires adb+
View obb+.sh
#!/bin/bash
######################################################################
#
#
# Obb+
# fkhairzad@
#
# Usage:
#
View split file name and extension.sh
FILE_BASE=`echo "${TEMPFILE%.*}"` #file without extension
FILE_EXT="${TEMPFILE##*.}" #file extension
@mortenjust
mortenjust / remap.java
Created Jan 16, 2016
processing-like map()
View remap.java
static float rangeMap(float value, float low1, float low2, float high1, float high2){
return low2 + (value - low1) * (high2 - low2) / (high1 - low1);
}
View map value from one range to another.swift
func rangeMap(whereIs value:Double, low1:Double, low2:Double, high1:Double, high2:Double) -> Double {
return low2 + (value - low1) * (high2 - low2) / (high1 - low1)
}
View Convert UIColor to HSBA values.swift
func getHSBA(color:UIColor) -> (hue:CGFloat, saturation:CGFloat, brightness:CGFloat, alpha:CGFloat) {
var hue:CGFloat = 0.0
var sat:CGFloat = 0.0
var bri:CGFloat = 0.0
var alpha:CGFloat = 0.0
color.getHue(&hue, saturation: &sat, brightness: &bri, alpha: &alpha)
return (hue:hue, saturation:sat, brightness:bri, alpha:alpha)
}
You can’t perform that action at this time.