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
| /* | |
| matches a string which contains : | |
| - min 8 chars | |
| - a lowercase letter | |
| - a capital letter | |
| - a number | |
| - a special char | |
| - no chars repeated more than twice | |
| */ |
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
| import * as mongoose from 'mongoose'; | |
| console.log(mongoose.connect); // undefined | |
| // but | |
| console.log(mongoose); | |
| /* | |
| { connections: | |
| [ NativeConnection { | |
| base: [Object], |
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
| /** | |
| * @module: string-inject | |
| * @version: 1.0.0 | |
| * @author: Lcf.vs | |
| * @copyright: © 2015 | |
| * @license: MIT | |
| * @exports: {function} inject(name, str, data) | |
| * @description: Injects some map-based data into a string | |
| * @param: {string} name | |
| * @description: The map name |
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 | |
| $service_port = getservbyname('http', 'tcp'); | |
| $address = gethostbyname('chat.dev.com'); | |
| $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
| $result = socket_connect($socket, $address, $service_port); | |
| // ... |
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
| span.error { | |
| color: red; | |
| display: block; | |
| } |
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
| // create this file | |
| import { anticore } from 'anticore' | |
| import { one } from 'anticore/dom/query/one' | |
| import { replace } from 'anticore/dom/tree/replace' | |
| anticore.on('main.exception', function (element, next, loaded) { | |
| loaded && replace(element, one('body > main')) | |
| next() | |
| }) |
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
| .fetching { | |
| pointer-events: none; | |
| } | |
| .fetching::after { | |
| content: ''; | |
| border-radius: 100%; | |
| border-top: .2em solid rgba(255, 255, 255, .9); | |
| border-left: .2em double rgba(255, 255, 255, .6); | |
| border-bottom: .2em dotted rgba(255, 255, 255, .3); |
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
| /** | |
| * Usage: | |
| * function fn([{a, b}, out], c) { | |
| * out.c = c | |
| * out.d = a + b + c | |
| * } | |
| * | |
| * const obj = {a: 1, b: 2} | |
| * io(fn, obj, 3) | |
| * console.log(obj) // obj = {a: 1, b: 2, c: 3, d: 6} |
OlderNewer