The exchange of new line & br HTML tag could refer to PHP - nl2br() function, which uses to inserts HTML line breaks before all newlines in a string.
These JavaScript functions consider whether to use insert or replace to handle the swap.
const MY_DOMAIN = "agodrich.com" | |
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2" | |
const DISQUS_SHORTNAME = "agodrich" | |
addEventListener('fetch', event => { | |
event.respondWith(fetchAndApply(event.request)) | |
}) | |
const corsHeaders = { | |
"Access-Control-Allow-Origin": "*", |
The exchange of new line & br HTML tag could refer to PHP - nl2br() function, which uses to inserts HTML line breaks before all newlines in a string.
These JavaScript functions consider whether to use insert or replace to handle the swap.
Build the native binding of a NodeJS library for multiple platforms/versions.
With no arguments, this script use the nearest node-gyp
installation to build binding.gyp
for the version of node
being used. Then it looks for binding.node
in the resulting build/Release
directory, and copies it into the vendor
directory (created on-the-fly). You will find it inside a subdirectory named ${process.platform}-${process.arch}-${moduleVersion}
.
When --target
or --version
are undefined, this script resolves their values for you.
NOTE: You must specify --version
if you specify --target
as a version not currently used by your shell.
After building the native binding, you can npm rm bindings
and use the provided binding.js
module for loading your native binding with require
. The binding.js
module is smart enough to know which vendor
subdirectory contains the appropriate binding for the current process.
<meta property="fb:app_id" content="406655189415060"> | |
<meta property="og:site_name" content="Giphy"> | |
<meta property="og:url" content="http://giphy.com/gifs/rhuber-test-djeEV9Xji6zjgLXBxug"> | |
<meta property="og:title" content="Animated GIF"> | |
<meta property="og:description" content="The best GIFs are on Giphy"> | |
<meta property="og:type" content="video.other"> | |
<meta property="og:image" content="http://media.giphy.com/media/djeEV9Xji6zjgLXBxug/giphy.gif"> | |
<meta property="og:image:width" content="912"> |
// gulpfile.js | |
var gulp = require('gulp'); | |
var requireDir = require('require-dir'); | |
var tasks = requireDir('./tasks'); | |
gulp.task('sass', tasks.sass); | |
gulp.task('serve:dev', tasks.serve.dev); | |
gulp.task('serve:dist', tasks.serve.dist); |
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0-modified | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
var | |
// Local ip address that we're trying to calculate | |
address | |
// Provides a few basic operating-system related utility functions (built-in) | |
,os = require('os') | |
// Network interfaces | |
,ifaces = os.networkInterfaces(); | |
// Iterate over interfaces ... |
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).