- Background: (39, 40, 34); #272822
- Comments: (103,157,71); #679D47
- White: (248, 248, 242); #F8F8F2
- String: (230, 219, 116); #E6DB74
- Green:(166, 226, 46); #A6E22E ![#A6E22E](https://placehold.co/15x15/A6E
Here is a quick and dirty workaround if you need to run your dev app on domains other than localhost :
- Install concurrently and http-proxy
yarn add concurrently http-proxy || npm install --save-dev concurrently http-proxy
- Add proxy-server.js
var http = require('http');
var httpProxy = require('http-proxy');
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
class TestYield | |
{ | |
private function clearDir() { | |
if (!is_dir('./files')) { | |
return; | |
} | |
if ($handle = opendir('./files')) { | |
while (false !== ($entry = readdir($handle))) { | |
if ($entry != "." && $entry != "..") { | |
// echo "$entry\n"; |
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 | |
namespace Evolutionnutrition\ApiBundle\Tests\Base; | |
use Evolutionnutrition\ApiBundle\Tests\Base\BaseUnitTests; | |
abstract class BaseControllerTests extends BaseUnitTests | |
{ | |
protected $controllerMethodsList = [ | |
'parseControls', |
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() { | |
const links = document.getElementsByTagName('a'); | |
for (let i = 0; i < links.length; i++) { | |
const a = links.item(i); | |
if (a.href && a.href.search('screencast.com') >= 0) { | |
console.log('screencast link', i, a); | |
let ifrFound = false; | |
for (let j = 0; j < a.childNodes.length; j++) { | |
if (a.childNodes.item(j).nodeName === 'IFRAME') { | |
ifrFound = true; |
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 getCaretPosition (value) { | |
// Initialize | |
let iCaretPos = 0; | |
const field = document.activeElement; | |
// IE Support | |
if (document.selection) { | |
// To get cursor position, get empty selection range |
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
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { parseDate, formatInput, formatDate } from './helpers'; | |
class FormattedDateField extends React.PureComponent { | |
static propTypes = { | |
date: PropTypes.instanceOf(Date), | |
onChange: PropTypes.func.isRequired, | |
}; |
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
/* | |
.ol-level-1 > .li-level-1 > .ol-level-2 > .li-level-2, .li-level-2_alpha counters | |
*/ | |
.ol-level-1, .ol-level-2 { | |
list-style-type: none; | |
counter-reset: terms-counter-y 0; | |
} | |
.li-level-1, .li-level-2 { | |
counter-increment: terms-counter-y 1; | |
} |
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
const fs = require('fs'); | |
const path = require('path'); | |
const async = require('async'); | |
function rmDir(dirPath, cb, removeSelf = true) { | |
try { | |
fs.readdir(dirPath, (err, files) => { | |
if (err) return cb(err); | |
// run tasks in parallel | |
async.each(files, (file, cb) => { |
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
const allowEvery = (f, delay = 300) => { | |
let timeOut = null; | |
let lastCall = null; | |
return (...args) => { | |
const n = Date.now(); | |
if (lastCall === null) { | |
lastCall = n; | |
} else if (n - lastCall > delay) { | |
lastCall = n; | |
f(...args); |
NewerOlder