For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Disable app nap system-wide (Requires Restart) | |
defaults write NSGlobalDomain NSAppSleepDisabled -bool YES | |
//Finder show hidden files | |
defaults write com.apple.finder AppleShowAllFiles YES; killall Finder | |
//Desktop hide icons | |
defaults write com.apple.finder CreateDesktop false; killall Finder | |
//TextEdit open new document by default (Requires restart of TextEdit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shilo: Benjamin! Benjamin! Benjamin! Benjamin! Benjamin! Benjamin! Boss! Boss! Boss! Leader! Leader! Leader! Master! Master! Master! Ben! | |
Ben! Ben! Ben! Benni! Benni! Benni! Benni! Benji! Benji! Benj! Benj! Benj! | |
Benjamin: What!? | |
Shilo: Hi! (Giggling and running out of the room) | |
https://www.youtube.com/watch?v=aOLxQGLJouI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Platform | |
{ | |
static let isSimulator: Bool = { | |
var isSim = false | |
#if arch(i386) || arch(x86_64) | |
isSim = true | |
#endif | |
return isSim | |
}() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.pad = function(size) { | |
var s = String(this); | |
while (s.length < (size || 2)) {s = "0" + s;} | |
return s; | |
} | |
(1).pad(3) // => "001" | |
(10).pad(3) // => "010" | |
(100).pad(3) // => "100" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gabesechan.android.reusable.receivers; | |
import java.util.Date; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.telephony.TelephonyManager; | |
public abstract class PhonecallReceiver extends BroadcastReceiver { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///Returns the input value clamped to the lower and upper limits. | |
func clamp<T: Comparable>(value: T, lower: T, upper: T) -> T { | |
return min(max(value, lower), upper) | |
} | |
//----------------------------------------------- | |
// Example usage | |
let proposedIndex = 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\Folder\shell\Unity5] | |
@="" | |
"Icon"="%ProgramFiles%\\Unity\\Editor\\Unity.exe" | |
"MUIVerb"="Open as Unity Project" | |
[HKEY_CLASSES_ROOT\Folder\shell\Unity5\Command] | |
@="cmd /c start /D\"c:\\Program Files\\Unity\\Editor\\\" Unity.exe -projectPath \"%1\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean isColorDark(int color){ | |
double darkness = 1-(0.299*Color.red(color) + 0.587*Color.green(color) + 0.114*Color.blue(color))/255; | |
if(darkness<0.5){ | |
return false; // It's a light color | |
}else{ | |
return true; // It's a dark color | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let toImage = UIImage(named:"image.png") | |
UIView.transitionWithView(self.imageView, | |
duration:5, | |
options: .TransitionCrossDissolve, | |
animations: { self.imageView.image = toImage }, | |
completion: nil) |