for when you have old, bad php code that you need to move forward in versions / migrate
This file contains hidden or 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
| function Delta-Process { | |
| Param( | |
| [Parameter(ValueFromPipeline = $true)] | |
| [System.Diagnostics.Process[]] | |
| $BaseProcesses | |
| ) | |
| $PostProcesses = Get-Process | |
| $NewProcesses = @() | |
| $PostProcesses | ForEach-Object { |
This file contains hidden or 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
| // WARNING: this will take some time, chrome might hiccup, you might be prompted in the URL bar to run unsafe scripts | |
| function saveFile(url, filename) { | |
| // Get file name from url. | |
| var xhr = new XMLHttpRequest(); | |
| xhr.responseType = 'blob'; | |
| xhr.onload = function() { | |
| var a = document.createElement('a'); | |
| a.href = window.URL.createObjectURL(xhr.response); // xhr.response is a blob | |
| a.download = filename; // Set the file name. | |
| a.style.display = 'none'; |
This file contains hidden or 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 possibleIcons = [ | |
| 'twitter-bird', | |
| 'mention', | |
| 'following', | |
| 'message', | |
| 'home', | |
| 'hashtag', | |
| 'reply', | |
| 'favorite', | |
| 'retweet', |
This file contains hidden or 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
| using UnityEngine; | |
| using System.Collections; | |
| using BeeCode.Extensions; | |
| namespace BeeCode.Utils { | |
| public static class ScreenCap { | |
| public static IEnumerator Deferred( UnityEngine.Events.UnityAction<Texture2D> onCapture ) { | |
| yield return new WaitForEndOfFrame(); | |
| Texture2D screenShot = new Texture2D( Screen.width, Screen.height, TextureFormat.RGB24, false ); | |
| screenShot.ReadPixels( new Rect( 0, 0, Screen.width, Screen.height ), 0, 0 ); |
This file contains hidden or 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
| using System.Collections.Generic; | |
| using System.Linq; | |
| using BeeCode.Extensions; | |
| using TMPro; | |
| using UnityEngine; | |
| using UnityEngine.SceneManagement; | |
| using UnityEngine.UI; | |
| namespace BBallCode.Engine { | |
| public static class IListBee { |
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
This file contains hidden or 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
| // webcrack, a script that allows you to break webpack.js's sandbox and randomization easily | |
| // made by @NO_BOOT_DEVICE | |
| // licensed under the trust that you will credit me for my work visibly and other than that you can go have fun with this | |
| // window.wc is the webcrack object | |
| // wc.get gives you the module attached to the id you give it. | |
| // literally just what webpack functions use. not much to it | |
| // this is the basic part of all this, everything else is just to allow you to updateproof your code | |
| // both find functions return modules in this format: |
This file contains hidden or 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 -e | |
| # | |
| # Purpose: Convert a Chromium extension zip into crx format | |
| # Source: https://developer.chrome.com/extensions/crx | |
| if test $# -ne 2; then | |
| echo "Usage: zip2crx.sh <zip file> <pem path>" | |
| exit 1 | |
| fi |
This file contains hidden or 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
| ; note: ~ is the name of my cygwin terminal | |
| WinActivate, ~ | |
| WinWaitActive, ~ | |
| ; even though your password will be interpreted literally | |
| ; autohotkey it will still process the entire file for being a valid script before it executes | |
| ; so if your password contains % then you need to escape it with ` in order to not make it process it as a variable name | |
| ; or if your password contains ` then you may need to escape it with another ` | |
| ; read more: https://autohotkey.com/docs/commands/Send.htm | |
| SendInput {Raw}YourLiteralPasswordHere |
