View divider.scss
.divider { | |
text-transform: uppercase; | |
color: $dark-grey; | |
font-weight: 600; | |
margin: 20px 0; | |
position: relative; | |
&:before, | |
&:after { | |
content: ""; |
View mixin.scss
$tablet-width: 768px; | |
$desktop-width: 875px; | |
$xl-desktop-width: 1351px; | |
$phone-width: 320px; | |
$iphone6-width: 375px; | |
$iphone6plus-width: 450px; | |
@mixin breakpoint($breakpoint) { | |
@if $breakpoint == "tablet" { | |
@media (min-width: #{$iphone6plus-width}) and (max-width: #{$desktop-width}) { |
View mixin.scss
@mixin breakpoint($point) { | |
@if $point == desktop { | |
@media (min-width: 70em) { | |
@content; | |
} | |
} | |
@else if $point == laptop { | |
@media (min-width: 64em) { | |
@content; | |
} |
View function.py
def get_if_int_or_float(value, under_num=1): | |
return int(value) if value.is_integer() else round(value, under_num) |
View onback.kt
private val backButtonSubject: Subject<Long> = BehaviorSubject.createDefault(0L).toSerialized() | |
private val backButtonSubjectDisposable = | |
compositeDisposable.add(backButtonSubject.toFlowable(BackpressureStrategy.BUFFER) | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) // need compose | |
.buffer(2, 1) | |
.map { it[0] to it[1] } | |
.subscribe({ value -> | |
if (value.second - value.first < 2000) getView()?.finishView() |
View modal.html
<a href="#modalBox" data-toggle="modal">OpenButton</a> | |
<div class="modal fade" id="modalBox" tabindex="-1" role="dialog" aria-labelledby="modal-label" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | |
<h4 class="modal-title" id="modal-label"> | |
Title Area | |
</h4> |
View export.sh
export $(cat .env | grep -v ^# | grep -v ^alias | xargs) |
View git.sh
git clone --mirror [OriginRepo.git] | |
cd [OriginRepo.git] | |
git remote set-url --push origin [New Repo.git] | |
git push --mirror |
View function.py
def get_client_ip(request): | |
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR') | |
if x_forwarded_for: | |
return x_forwarded_for.split(',')[0] | |
else: | |
return request.META.get('REMOTE_ADDR') |