Skip to content

Instantly share code, notes, and snippets.

@dewdad
dewdad / README.md
Last active June 3, 2019 05:59
PollyJS setup with Vue and FakerJS

Add the deps to package.json

scripts:{
    "serve": "vue-cli-service serve",
    "dev": "run-p record serve", // run-p uses npm-run-all to run scripts in parallel, cross platform
    "record": "polly listen -p 4244",
},
"devDependencies": {
 "@pollyjs/adapter-fetch": "^2.4.0",
 "@pollyjs/adapter-xhr": "^2.4.0",
@dewdad
dewdad / multiroute.proxy.js
Created May 11, 2019 10:34
Webpack devserver configs
/**
* Proxy guide at:
* https://github.com/chimurai/http-proxy-middleware
* https://github.com/chimurai/http-proxy-middleware/tree/master/recipes
*/
const domains = [
'domain.ext',
'domain2.ext'
];
@dewdad
dewdad / debloatNox.md
Created April 18, 2019 11:59 — forked from Log1x/debloatNox.md
Debloating & Optimizing Nox

Debloating Nox

Nox, despite being the most feature-filled Android emulator, has a lot of negativity surrounding it due to their antics when it comes to making income off of their program. It is known for running repeated advertisments in the background, calling home and passing along system information (outside of your Android instance) as well as a vast amount of potentially sensitive data in an encrypted payload back to their multitude of servers. With the following preventitive measures, we can stop a majority of this happening as well as greatly improve the overall performance.

  1. Download and Install a fresh copy of Nox. The latest version is fine (for now). If you already have it installed, that is fine too. No need to reinstall.

  2. Enable Root Mode on Nox by clicking the gear icon and then checking the Root Startup box.

  3. Install a new Launcher from the Play Store. ANYTHING but Nox's default. I suggest [Nova Launcher](https://play.google.com/s

@dewdad
dewdad / FiddlerScript.cs
Created March 22, 2019 19:46 — forked from antelle/FiddlerScript.cs
Change response in Fiddler
static function OnBeforeRequest(oSession: Session) {
if (oSession.RequestMethod == 'GET' && oSession.PathAndQuery.IndexOf('part_of_your_url') > 0) {
oSession.utilCreateResponseAndBypassServer();
oSession.oResponse.headers.HTTPResponseCode = 401;
oSession.oResponse.headers.HTTPResponseStatus = '401 Not Authorized';
oSession.oResponse.headers['Access-Control-Allow-Origin'] = '*';
oSession.utilSetResponseBody('response_body');
}
}
@dewdad
dewdad / GitForWindowsSetup.md
Created February 18, 2019 09:50 — forked from dmangiarelli/GitForWindowsSetup.md
How to setup SSH with Git for Windows

How to setup Git for Windows

I know this document seems long, but it shouldn't be too difficult to follow. This guide is based on Windows, but every program here has Linux/Mac equivalents, and in most cases they're built-in. So, take a deep breath and go step by step.

The steps below are for GitHub, but the steps are almost idential for Bitbucket, Heroku, etc.

You'll probably want to make sure Chocolatey is installed, since it streamlines installing this stuff later. If you install via Chocolatey, you don't need to run the installers from the products' respective sites.

Cmder / ConEmu

@dewdad
dewdad / docker-compose.yml
Last active December 12, 2018 05:19
docker-compose file for PostgreSQL and Adminer that works on Windows
version: "3.7"
volumes:
postgres-data:
services:
database:
image: postgres:11-alpine
restart: always
expose:
- "5432"
@dewdad
dewdad / require
Last active April 26, 2024 23:12
Chrome Dev Snippets
window.require = function(name, moduleName) {
_require = require;
if(!moduleName) {
moduleName = name;
}
console.log('Fetching ' + moduleName + '... just one second');
fetch('https://wzrd.in/bundle/' + moduleName + '@latest/')
.then(response => response.text())
@dewdad
dewdad / interceptors.js
Created June 10, 2018 11:30 — forked from javisperez/interceptors.js
Axios interceptor for cache with js-cache
// Usually I use this in my app's config file, in case I need to disable all cache from the app
// Cache is from `js-cache`, something like `import Cache from 'js-cache';`
const cacheable = true,
cache = new Cache();
// On request, return the cached version, if any
axios.interceptors.request.use(request => {
// Only cache GET requests
if (request.method === 'get' && cacheable) {
@dewdad
dewdad / Reset-BashPassword.ps1
Created April 29, 2018 11:32 — forked from richardszalay/Reset-BashPassword.ps1
Reset-BashPassword.ps1
# Resets the password for the default LXSS / WSL bash user, based on https://askubuntu.com/a/808425/697555
$lxssUsername = (Get-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss).DefaultUsername
lxrun /setdefaultuser root
bash -c "passwd $lxssUsername"
lxrun /setdefaultuser $lxssUsername