start new:
tmux
start new with session name:
tmux new -s myname
const carColor = "red" | |
// will use the shorthand notation to create an object and get the first element of the keys array | |
const [carColorVaribale] = Object.keys({carColor}) | |
const log = `Variable ${carColorVaribale} has an value of ${carColor}` | |
// "Variable carColor has an value of red" |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
def magic(n): | |
units = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine "] | |
teens = ["", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"] | |
tens = ["", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] | |
thousands = ["","thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion", "septillion", "octillion", "nonillion", "decillion", "undecillion", "duodecillion", "tredecillion", "quattuordecillion", "sexdecillion", "septendecillion", "octodecillion", "novemdecillion", "vigintillion "] | |
words = [] | |
wordLength = 0 | |
if n < 0: | |
return wordLength |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
elem.clientLeft
, elem.clientTop
, elem.clientWidth
, elem.clientHeight
elem.getClientRects()
, elem.getBoundingClientRect()
UIView *myView = cell.containerView; | |
CALayer *layer = myView.layer; | |
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; | |
rotationAndPerspectiveTransform.m34 = 1.0 / -1000; | |
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI / 0.3, 0.0f, 1.0f, 0.0f); | |
layer.transform = rotationAndPerspectiveTransform; | |
[UIView animateWithDuration:1.0 animations:^{ | |
layer.transform = CATransform3DIdentity; | |
}]; |
<form class="tw-bs form-inline"> | |
<div class="form-group"> | |
<label class="sr-only" for="weight">Weight (in killograms)</label> | |
<div class="input-group"> | |
<input type="number" class="text-right form-control" id="weight" placeholder="Weight" value="80"> | |
<div class="input-group-addon">Kgs</div> | |
</div> | |
</div> | |
</form> |
//BOUNCE ANIMATION | |
-(void)beginBounceAnimation { | |
self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001); | |
self.view.alpha = 1.0; | |
[UIView beginAnimations:nil context:nil]; | |
[UIView setAnimationDuration:0.25]; | |
[UIView setAnimationDelegate:self]; | |
[UIView setAnimationDidStopSelector:@selector(bounce1AnimationStopped)]; | |
self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1); | |
[UIView commitAnimations]; |