#Mac OS X
This file contains hidden or 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
| aspect.before(win.body(), (!has("mozilla") ? "onmousewheel" : "DOMMouseScroll"), function () { | |
| // scrolling | |
| }); |
This file contains hidden or 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
| <VirtualHost *:80> | |
| ServerName dev.local | |
| ServerAlias *.dev.local | |
| DocumentRoot /var/www/vhosts/ | |
| # get the server name from the Host: header | |
| UseCanonicalName Off | |
| LogLevel warn | |
| LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon |
This file contains hidden or 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 static function getYoutubeVideoIdFromUrl($url) | |
| { | |
| // Check for a valid youtube url | |
| $rx = '~ # Using ~ to avoid LTS (http://en.wikipedia.org/wiki/Leaning_toothpick_syndrome) | |
| ^http(?:s)?:// # Mandatory protocol (optional ssl) | |
| (?:www\.)? # Optional subdomain | |
| (?:youtube\.com/watch(?:/)?\?v=|youtu\.be/) # mandatory domain & path for youtube or shortlink for youtu.be | |
| ([^?&]+) # video id as capture group 1 | |
| ~x'; |
This file contains hidden or 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
| mysqldump -u root --password=xx -F --opt --databases thedbname --ignore-table=thedbname.firsttablename --ignore-table=thedbname.secondtablename | gzip > "thecompresseddump.bak.sql.gz" & |
This file contains hidden or 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
| $(function() { | |
| if( document.cookie.indexOf( "facebookModalPromoShowOnce" ) < 0 ) { | |
| $( "#dialog-facebook-message" ).dialog({ | |
| modal: true, | |
| resizable: false, | |
| show: 'slide', | |
| buttons: { | |
| Ok: function() { | |
| $( this ).dialog( "close" ); | |
| document.cookie = "facebookModalPromoShowOnce=true; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/"; |
This file contains hidden or 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
| .hyphenate { | |
| overflow-wrap: break-word; | |
| word-wrap: break-word; | |
| -webkit-hyphens: auto; | |
| -ms-hyphens: auto; | |
| -moz-hyphens: auto; | |
| hyphens: auto; | |
| } |
This file contains hidden or 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
| using Entitas; | |
| using UnityEngine; | |
| public class TimerSystem : IExecuteSystem, ICleanupSystem | |
| { | |
| readonly IGroup<GameEntity> _timers; | |
| readonly IGroup<GameEntity> _timerCompletes; | |
| readonly GameContext _context; | |
| public TimerSystem(Contexts contexts) |
This file contains hidden or 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
| void Start() | |
| { | |
| // ... | |
| _contexts.game.OnEntityCreated += AddId; | |
| _contexts.input.OnEntityCreated += AddId; | |
| // ... | |
| } | |
| private void AddId(IContext context, IEntity entity) | |
| { |
This file contains hidden or 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 MyNetworkManager:NetworkManager | |
| { | |
| public T InstantiateNetworkObject<T>(GameObject[] networkObjects, int index, Vector3? position = null, Quaternion? rotation = null, bool sendTransform = true) where T:NetworkBehavior | |
| { | |
| var go = Instantiate(networkObjects[index]); | |
| var netBehavior = go.GetComponent<T>(); | |
| NetworkObject obj = null; | |
| if (!sendTransform && position == null && rotation == null) | |
| obj = netBehavior.CreateNetworkObject(Networker, index); |
OlderNewer