I hereby claim:
- I am xxzefgh on github.
- I am xxzefgh (https://keybase.io/xxzefgh) on keybase.
- I have a public key ASCP4gS21C15pcLXjdoq6908QlL0X_OOProk4k2DY6o-_wo
To claim this, I am signing this object:
<?php | |
class LaravelBridge | |
{ | |
private static $app = null; | |
private static $kernel = null; | |
private static function init() | |
{ | |
if (!self::$app || !self::$kernel) { |
#!/bin/bash | |
app_path="/path/to/target/folder" | |
if [ ! -d $app_path ]; then | |
mkdir -p $app_path; | |
fi | |
while read oldrev newrev ref | |
do |
<?php | |
namespace App; | |
use Illuminate\Support\Arr; | |
use Illuminate\Support\Str; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Database\Eloquent\Relations\Relation; | |
use Illuminate\Database\Eloquent\Relations\BelongsTo; |
// declarations | |
var positions = []; | |
// Returns a random integer between min (included) and max (excluded) | |
// Using Math.round() will give you a non-uniform distribution! | |
function getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min)) + min; | |
} | |
// generate random positions |
upstream example { | |
server localhost:8080; | |
} | |
server { | |
listen 80; | |
server_name example.com; | |
server_tokens off; | |
location / { |
export function snakeToCamel(str) { | |
return str.toLowerCase().replace(/_(.)/g, (match, $1) => $1.toUpperCase()) | |
} |
const vp9CodecType = 'video/webm; codecs="vp9"' | |
function checkMediaSourceWay() { | |
return 'MediaSource' in window && MediaSource.isTypeSupported(vp9CodecType) | |
} | |
function checkHTMLMediaElementWay() { | |
return document.createElement('video').canPlayType(vp9CodecType) === 'probably' | |
} |
I hereby claim:
To claim this, I am signing this object:
function formatMoney(value: any, thousandSeparator: string | false = false, fractionDigits = 2): string { | |
let number = Number(value); | |
if (isNaN(number)) { | |
number = 0; | |
} | |
// Number#toFixed will throw runtime exception if fractionDigits isn't within 0-100 range | |
if (fractionDigits < 0 || fractionDigits > 100) { | |
fractionDigits = 0; | |
} |
import {Directive, Input, HostListener} from '@angular/core'; | |
@Directive({ | |
selector: 'img[fallback]' | |
}) | |
export class ImageFallbackDirective { | |
private _fallback = 'assets/images/404_image.png'; | |
@Input() set fallback(value: string) { | |
if (value && value.length > 0) { |