Skip to content

Instantly share code, notes, and snippets.

@8ctopotamus
8ctopotamus / quick-esc.js
Last active January 18, 2018 16:52
Quick-escape functionality
(function() {
// the ESC button on the page
var quickESCButton = document.getElementById('quick-esc')
function getAway() {
// open new tab with innocent site
window.open("http://weather.com", "_newtab")
// replace current site with another benign site
window.location.replace('http://google.com')
}
@8ctopotamus
8ctopotamus / gatsby-build-DOM-protection-example.js
Last active November 24, 2020 14:26
gatbys build DOM protection: Avoid Gatsby Build Errors when working with DOM
// we need to guard against anything that uses document or window
// for the gatsby build to work because there is no DOM in the build process.
// Example of importing a package such as sketch-js:
let sketch
if (typeof document !== 'undefined')
sketch = require('sketch-js')
### You need to do this first:
# 1 .Enable External option in Unity → Preferences → Packages → Repository (only if Unity ver < 4.5)
# 2. Switch to Visible Meta Files in Edit → Project Settings → Editor → Version Control Mode
# 3. Switch to Force Text in Edit → Project Settings → Editor → Asset Serialization Mode
# 4. Save Scene and Project from File menu.
# 5. Quit Unity and then you can delete the Library and Temp directory in the project directory. You can delete everything but keep the Assets and ProjectSettings directory.
@8ctopotamus
8ctopotamus / CycleCameraUnity.cs
Created September 11, 2017 21:12
Cycling through Cameras Unity3D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameController : MonoBehaviour {
public GameObject[] gameCameras;
private int gameCameraIndex = 0;
@8ctopotamus
8ctopotamus / Fix image upload HTTP ERROR on InmotionHosting.txt
Created September 11, 2017 15:48
Fix image upload HTTP ERROR on InmotionHosting
# Add this to the .htaccess
# fix image upload HTTP ERROR on inmotion hosting
SetEnv MAGICK_THREAD_LIMIT 1