Skip to content

Instantly share code, notes, and snippets.

View parkerproject's full-sized avatar

Parker parkerproject

View GitHub Profile
@parkerproject
parkerproject / app.js
Created October 28, 2021 18:03 — forked from zt4ff/app.js
Move desktop mouse and keyboard using NodeJS
const yargs = require("yargs");
const robot = require("robotjs");
const { hideBin } = require("yargs/helpers");
let is_both;
let is_mouse;
let is_keyboard;
const arg = yargs(hideBin(process.argv))
.command("$0 [interval]", true, (yargs) => {
// Self invoking function
(function(w, d, link, script, p) {
window.onload = function() {
// Load css
var css = "https://cd.example.com/widget.css";
// Load js
var js = "https://cd.example.com/widget.js";
link = d.createElement("link");
link.rel = "stylesheet";
# Protect WooCommerce upload folder from being accessed directly.
# You may want to change this config if you are using "Redirect Only" method for downloadable products.
# Place this config towards the end of "server" block in nGinx configuration.
location ~* /wp-content/uploads/woocommerce_uploads/ {
if ( $upstream_http_x_accel_redirect = "" ) {
return 403;
}
internal;
}
@parkerproject
parkerproject / widget.md
Created August 2, 2021 19:27 — forked from AlexxNB/widget.md
Howto make no-depends widget on Svelte and load it on the page

We should have at least three files: 'Widget.svelte', 'rollup.config.js' and 'package.json':

  1. Our widget Widget.svelte:
<script>
	export let name;
</script>

<h1>Hello {name}!</h1>
@parkerproject
parkerproject / TypeScriptMigration.md
Created May 13, 2021 15:49 — forked from xiaoyunyang/TypeScriptMigration.md
A guide for how to migrate your project from Flow to TypeScript
let result = {
unique: [],
frequent: []
}
const arr1 = ['a', 'b', 'c', 'e', 'j', 'f']
const arr2 = ['a', 'a', 'f', 'b', 'g', 'r', 'e', 'f', 't']
let count = {}

Authors Guide: Article Template

Please submit your article including all of the information below. You can include this as a seperate file if you like - but please complete each section. Please use an online service to write your article, for example Dropbox Paper, Draft.in, Google Docs. For more help, see the editorial guide

Article Title

Ideally under 67 characters, what problem does this article solve?

Quick Summary

@parkerproject
parkerproject / gist:67b0c9e7b52366cef18cc6e1012ef009
Created January 14, 2021 03:27 — forked from sangkyoonnam/gist:9128870
Node.js Hello World with Express.js
/**
* Module Dependencies
*/
var express = require('express');
var app = express();
/**
* Configuration
*/
@parkerproject
parkerproject / directUploadToS3.js
Created December 26, 2020 01:04 — forked from DWboutin/directUploadToS3.js
Direct image url to S3 wiht axios and nodejs
import AWS from 'aws-sdk';
import stream from 'stream'
import axios from 'axios';
export default async (url, filename, callback) => {
const s3 = new AWS.S3({ params: { Bucket: process.env.STATIC_MAPS_BUCKET }});
let contentType = 'application/octet-stream'
let promise = null
const uploadStream = () => {