Boilerplate w/ Laravel example: https://github.com/jpalala/laravel-customjs-boilerplate
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
{ | |
"private": true, | |
"scripts": { | |
"dev": "npm run development", | |
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"watch": "npm run development -- --watch", | |
"watch-poll": "npm run watch -- --watch-poll", | |
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"prod": "npm run production", | |
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" |
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
<script> | |
/* https://svelte.dev/repl/20f592923f584d6e9399392d4864e55a?version=3.48.0 */ | |
import NextPage from './NextPage.svelte'; | |
import { pageNum } from './stores.js'; | |
let page; | |
let pageNumber; | |
let slides = ["<b>i</b>", "<b>love</b>", "<b>svelte</b>"]; | |
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
<?php | |
$ENV['GITHUB_CLIENT_SECRET' => 'YOUR_CLIENT_SECRET', 'GITHUB_CLIENT_ID' => 'YOUR_CLIENT_ID']; | |
if (!function_exists('dd')) { | |
function dd() | |
{ | |
echo '<pre>'; | |
array_map(function($x) {var_dump($x);}, func_get_args()); | |
die; | |
} |
function update(target) {
var sources = [].slice.call(arguments, 1);
sources.forEach(function (source) {
Object.getOwnPropertyNames(source).forEach(function(propName) {
Object.defineProperty(target, propName,
Object.getOwnPropertyDescriptor(source, propName));
});
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 { createReadStream, createWriteStream } = require('fs'); | |
const { AsyncParser } = require('json2csv'); | |
const fields = ['field1', 'field2', 'field3']; | |
const opts = { fields }; | |
const transformOpts = { highWaterMark: 8192 }; | |
// Using the promise API | |
const input = createReadStream(inputPath, { encoding: 'utf8' }); |
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
# PHP | |
# Test and package your PHP project. | |
# Add steps that run tests, save build artifacts, deploy, and more: | |
# https://docs.microsoft.com/azure/devops/pipelines/languages/php | |
pool: | |
vmImage: 'Ubuntu 16.04' | |
variables: | |
phpVersion: 7.2 |
Source from Log users click without slowing the website down
$(function(){
$('div.join-link').click(function(){
var data-url = $(this).attr('data-target-url');
$.ajax({
type: 'POST',
url: 'http://yourdomain.com/log_clicks.php',
success:function(){window.location.href= data-url;},
Idea to rate limit posts to comments
Idea that at least 1 admin / 2-3 community members approve first
2-3 community members approve to be in front page - if they find it interesting it goes on the front page
//https://www.npmjs.com/package/get-website-favico
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
#!/bin/bash | |
# Source: https://github.com/technicalpickles/pickled-vim/blob/master/script/setup | |
set -e | |
cd "$(dirname "$0")/.." | |
if [ "$(uname -s)" = "Darwin" ]; then | |
brew bundle check >/dev/null 2>&1 || { | |
echo "==> Installing Homebrew dependencies…" | |
brew bundle | |
} |