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
let buffer = getWebSocket() | |
.bufferTime(1000); | |
let gate = new BehaviorSubject(true); | |
let batchSize = 50; | |
let batchSizeCounter = 0; | |
let results = gate | |
.switchMap(enabled => enabled ? buffer : Observable.never()) | |
.do(buffer => { |
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<?php print $html_attributes; ?>> | |
<head> | |
<?php print $head; ?> | |
<title><?php print $head_title; ?></title> | |
<?php print $styles; ?> | |
<?php print $head_scripts; ?> | |
</head> | |
<body<?php print $body_attributes;?>> |
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 | |
/** | |
* Requires php >= 5.5 | |
* | |
* Use this script to convert utf-8 data in utf-8 mysql tables stored via latin1 connection | |
* This is a PHP port from: https://gist.github.com/njvack/6113127 | |
* | |
* @link : http://www.ridesidecar.com/2013/07/30/of-databases-and-character-encodings/ | |
* | |
* BACKUP YOUR DATABASE BEFORE YOU RUN THIS SCRIPT! |
This gist assumes:
- you have a local git repo
- with an online remote repository (github / bitbucket etc)
- and a cloud server (Rackspace cloud / Amazon EC2 etc)
- your (PHP) scripts are served from /var/www/html/
- your webpages are executed by apache
- apache's home directory is /var/www/
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 | |
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder; | |
$encoder = new MessageDigestPasswordEncoder(); | |
echo $encoder->encodePassword('foo', ''); | |
// 5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg== |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
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
/** | |
* Stand alone polyfill allow only numbers on input of type number. | |
* | |
* While input filtering is already supported by default by some browsers, maximum length has not been implemented by | |
* any. This script will solve both issue and make sure that only digits can be entered in input elements of type | |
* number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on | |
* input of type text. | |
* | |
* Supports: | |
* |
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
(function(window, undefined) { | |
var strEq = function(str1, str2) { | |
return str1.toLowerCase() === str2.toLowerCase(); | |
}; | |
var ajaxRequest = function(method, opts) { | |
opts = opts ? opts : {}; | |
opts.data = opts.data || null; | |
opts.success = opts.success || function() { }; |
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
set :dev_only_files, [web_path + "/app_dev.php", web_path + "/check.php", web_path + "/config.php"] | |
set :production, true | |
after 'symfony:cache:warmup', 'pff:productify' | |
namespace :pff do | |
desc "Remove app_dev.php, check.php and config.php from production deployment" | |
task :productify, :except => { :production => false } do | |
if dev_only_files | |
pretty_print "--> Removing app_dev.php, config.php, and check.php from web" |
NewerOlder