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
<?php | |
public function createUrl($string) | |
{ | |
$output = preg_replace('~[^\\pL0-9_]+~u', '-', $string); | |
$output = trim($output, '-'); | |
$output = iconv('UTF-8', 'us-ascii//TRANSLIT', $output); | |
$output = strtolower($output); | |
$output = preg_replace('~[^-a-z0-9_]+~', '', $output); | |
return $output; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<style> | |
.rotate-device { | |
display: none; | |
} | |
@media (orientation: landscape) and (max-height: 500px) { | |
html, body { |
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 class ClipsLength : MonoBehaviour | |
void Start() | |
{ | |
AnimationClip[] clips = gameObject.GetComponent<Animator>().runtimeAnimatorController.animationClips; | |
foreach(AnimationClip clip in clips) | |
{ | |
Debug.Log(clip.name); | |
Debug.Log(clip.length); | |
} | |
} |
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
if (typeof lightbox !== 'undefined') { | |
lightbox.option({ | |
'resizeDuration': 200, | |
'albumLabel': '%1 / %2', | |
'fadeDuration': 200, | |
'imageFadeDuration': 0, | |
}) | |
} |
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
{% use "bootstrap_4_layout.html.twig" %} | |
{% block form_row -%} | |
{%- if compound is defined and compound -%} | |
{%- set element = 'fieldset' -%} | |
{%- endif -%} | |
{%- set widget_attr = {} -%} | |
{%- if help is not empty -%} | |
{%- set widget_attr = {attr: {'aria-describedby': id ~"_help"}} -%} | |
{%- endif -%} |
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
// Generate C# classes from schemas | |
flatc -n *.fbs | |
// JSON to binary | |
flatc --binary schema.fbs source.json | |
// binary to JSON | |
flatc --raw-binary -t schema.fbs -- source.bin |
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
sudo yum install -y gcc wget | |
wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make | |
sudo cp src/redis-cli /usr/bin/ |