SASS Versions of
- Fontawesome 5
- Bootstrap 4
in Phoenix 1.3 and 1.4 via Webpack
SASS Versions of
in Phoenix 1.3 and 1.4 via Webpack
# generate a script ./clone-repos.sh from a list of repos fetched via Bitbucket API | |
# note: requires 'curl' and 'jq' to be installed | |
set -e | |
echo -n '' > clone-repos.sh | |
chmod +x clone-repos.sh | |
ONPREM_USER=xxxxx | |
ONPREM_PASS=...... |
import * as path from 'path'; | |
import * as os from 'os'; | |
import * as fs from 'fs'; | |
import * as admin from 'firebase-admin'; | |
const exportToFile = async (req, _, next) => { | |
try { | |
const fileName = 'test002.csv'; | |
const tempFilePath = path.join(os.tmpdir(), fileName); |
Complete code in
math.directive.ts
After reading this you will be able to create a structural directive with inputs and context variables and use it like this:
<div *math="10; exponent: 3; let input;
let exponent = exponent; let r = root;
let p = power; let ctrl = controller">
const findScrollContainer = (element) => { | |
if (!element) { | |
return undefined; | |
} | |
let parent = element.parentElement; | |
while (parent) { | |
const { overflow } = window.getComputedStyle(parent); | |
if (overflow.split(' ').every(o => o === 'auto' || o === 'scroll')) { | |
return parent; |
postForm('http://example.com/api/v1/users', 'form#userEdit') | |
.then(data => console.log(data)) | |
function postForm(url, formSelector) { | |
const formData = new FormData(document.querySelector(formSelector)) | |
return fetch(url, { | |
method: 'POST', // 'GET', 'PUT', 'DELETE', etc. | |
body: formData // a FormData will automatically set the 'Content-Type' | |
}) |
const puppeteer = require('puppeteer') | |
;(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://youtube.com'); | |
// get a list of all elements - same as document.querySelectorAll('*') | |
const elements = await page.$$('*') |
<!-- wInViewRoot directive is needed to specify the `root` for `IntersectionObserver` and some other it's options e.g. `margin` --> | |
<div class="container" wInViewRoot="viewport"> | |
Any content can be here | |
<w-in-view-item> | |
<!-- Content will be replaced by a placeholder <div> with the same height as original content. | |
Also `InViewItemComponent`s change detector will be detached when it become invisible which means | |
all the content's change detectors won't be reachable and will be inactive as well. --> | |
</w-in-view-item> | |
...or any other content can be here | |
<w-in-view-item> |
function callAjax(payload){ | |
//- formSelector | |
//- portalId | |
//- formGUID | |
//- hideMessageTime | |
//- callback | |
// | |
var $form = $(payload.formSelector); | |
var form = $form[0]; | |
var url = "https://api.hsforms.com/submissions/v3/integration/submit/" + payload.portalId + "/" + payload.formGUID |
First, install it, using apt, yum, pacman, etc.
Imagine we want to back up files from Directory1 to Directory2, and both are on the same hard drive (this would work the same if the directories are on two different drives). There are several different ways to do this, depending on what kind of backups (i.e., options you want to give rsync) you want to configure. The most general, will be this:
$ rsync -av --delete /Directory1/ /Directory2/