Skip to content

Instantly share code, notes, and snippets.

@dewdad
dewdad / 0_reuse_code.js
Created February 5, 2014 18:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dewdad
dewdad / proxy.js
Last active August 29, 2015 14:12 — forked from jasper07/proxy.js
var express = require('express'),
httpProxy = require('http-proxy'),
proxy = new httpProxy.createProxyServer();
var routing = {
'sapui5': {
target: 'http://localhost:8001' //sdk
},
'apps': {
target: 'http://localhost:8002' //applications
@dewdad
dewdad / index.md
Created February 15, 2018 08:03 — forked from mathisonian/index.md
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

@dewdad
dewdad / ProxySettings.java
Created March 4, 2018 10:32 — forked from madeye/ProxySettings.java
Set proxy for Android Webview
package me.madeye;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.apache.http.HttpHost;
import android.content.Context;
@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
@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 / 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 / Vue Ecosystem.md
Last active April 8, 2019 16:34 — forked from LeCoupa/vue_js_cheatsheet.js
Vue js Cheatsheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
@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 / 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