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
echo '<pre>'; | |
$subject='<p>Lorem</p> | |
<pre class="brush:js;auto-links:false;toolbar:false" contenteditable="false"> //$(\'textarea[name=html]\').editor(); | |
tinymce.init({selector:\'textarea[name=html]\', | |
plugins: [ // plugins list | |
"preview sh4tinymce wordcount" | |
], | |
toolbar: "undo redo | sh4tinymce | preview" // toolbar list | |
});</pre> | |
<p> Ipsum dolor sit amet</p>'; |
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
var fs=require('fs'); | |
var lazy = require("lazy") | |
function CSVReader(linesToSkip,separator,convertKeyFunction){ | |
if(!linesToSkip){ | |
linesToSkip=0; | |
} | |
if(!separator){ | |
separator=';'; | |
} | |
this._linesToSkip=linesToSkip; |
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
from unittest.mock import patch | |
def spy(target, attribute, **kwargs): | |
if kwargs.get('wraps') is None: | |
kwargs['wraps'] = getattr(target, attribute) | |
return patch.object(target, attribute , **kwargs) |
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
var http = require('https'); | |
var MongoClient = require('mongodb'); | |
var url = require('url'); | |
function get(path,cb){ | |
var config = url.parse(path); | |
config.headers = {'user-agent': 'drFabio'}; | |
http.get(config , function(response) { | |
var body = ''; | |
response.on('data', function(d) { |
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
MyPlugin.prototype.apply = function(compiler) { | |
compiler.plugin("entry-option", function(context, entry) { | |
function itemToPlugin(item, name) { | |
if(Array.isArray(item)) | |
return new MultiEntryPlugin(context, item, name); | |
else | |
return new SingleEntryPlugin(context, item, name); | |
} | |
compiler.apply(itemToPlugin(entry,'main')); | |
compiler.apply(itemToPlugin(__dirname+'/someFile.md','target/name')); |
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 { apolloExpress, graphiqlExpress } = require('apollo-server'); | |
const { makeExecutableSchema } = require('graphql-tools') | |
const express = require('express') | |
const cors = require('cors') | |
const bodyParser = require('body-parser') | |
//Your schema declaration herte | |
const typeDefs = require('./schema') | |
const schemaOptions = { | |
typeDefs, |
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 express = require('express') | |
const { apolloExpress, graphiqlExpress } = require('apollo-server'); | |
const cors = require('cors') | |
const { makeExecutableSchema } = require('graphql-tools') | |
const bodyParser = require('body-parser') | |
const typeDefs = ` | |
type Minimal{ | |
id: ID! | |
name: String |
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 assert = require('assert') | |
/** | |
* Returns a nested array into a flatten single level array | |
* @param {Array} input a multiple level array | |
* @return {Array} an one level array of all the elements inside | |
*/ | |
function flatten (input) { | |
return input.reduce((ret, el) => { | |
if (Array.isArray(el)) { | |
ret = ret.concat(flatten(el)) |
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
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"> | |
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> |
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
#wrapper { | |
background-color: #7db9e8; | |
background: -moz-linear-gradient(top, #7db9e8 0%, #2989d8 12%, #0f0f0f 100%); | |
background: -webkit-linear-gradient(top, #7db9e8 0%,#2989d8 12%,#0f0f0f 100%); | |
background: linear-gradient(to bottom, #7db9e8 0%,#2989d8 12%,#0f0f0f 100%); | |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7db9e8', endColorstr='#0f0f0f',GradientType=0 ); | |
} |
OlderNewer