Skip to content

Instantly share code, notes, and snippets.

@Lcfvs
Lcfvs / fiddle.css
Last active May 4, 2017 09:29
anticore demo
span.error {
color: red;
display: block;
}
<?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);
// ...
@Lcfvs
Lcfvs / string-inject.js
Created May 3, 2016 14:26
Simple & controlled template string emulation
/**
* @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
import * as mongoose from 'mongoose';
console.log(mongoose.connect); // undefined
// but
console.log(mongoose);
/*
{ connections:
[ NativeConnection {
base: [Object],
/*
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
*/