var scriptSrc='//cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js';
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'script.js';
script.src = scriptSrc;
document.head.appendChild(script);
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
| #!/usr/bin/env bash | |
| # ~/.ssh/gcp-start-iap-tunnel-ssh-proxy-magic.sh | |
| # a script to be used as SSH ProxyCommand to allow fully functional SSH access to any Google Cloud Compute Engine VMs allowing IAP access | |
| # | |
| # Author: ahkui <ahkui@outlook.com> | |
| # Created: 2026-03-27 | |
| # See also: | |
| # - https://gist.github.com/netj/df4f9de1fefd254ab11979be7035b5d0/#readme | |
| # - https://cloud.google.com/iap/docs/using-tcp-forwarding | |
| # |
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
| // This code will automatically save the current canvas as a .png file. | |
| // Its useful as it can be placed in a loop to grab multiple canvas frames, I use it to create thumbnail gifs for my blog | |
| // Only seems to work with Chrome | |
| // Get the canvas | |
| var canvas = document.getElementById("canvas"); | |
| // Convert the canvas to data | |
| var image = canvas.toDataURL(); | |
| // Create a link | |
| var aDownloadLink = document.createElement('a'); |
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (
xcode-select --installwill prompt up a dialog) - Java
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
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
| <?php | |
| //https://github.com/laravel/framework/issues/2093#issuecomment-39154456 | |
| use Illuminate\Database\Eloquent\Model as Eloquent; | |
| use Illuminate\Database\Eloquent\Relations\Pivot; | |
| class User extends Eloquent { | |
| public function groups() { | |
| return $this->belongsToMany('Group'); |
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
| Secure sessions are easy, but it's not very well documented, so I'm changing that. | |
| Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy: | |
| The desired configuration for using NginX as an SSL proxy is to offload SSL processing | |
| and to put a hardened web server in front of your Node.js application, like: | |
| [NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [CLIENT] | |
| To do this, here's what you need to do: |
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/sh | |
| apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| software-properties-common \ | |
| language-pack-en-base && \ | |
| LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php && \ | |
| apt-get update && \ | |
| apt-get upgrade -y && \ | |
| apt-get install -y \ | |
| curl \ |
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
| Work in Progress: More testing to be done. | |
| At a glance Authentication, Activation, Throttle, Groups & Permissions seem to | |
| be working. | |
| Downside: Copy and modify files. | |
| Upside: Not really much work to get it up and running. | |
| Assumes you have Laravel 5.1, jenssegers/laravel-mongodb + session addon set up | |
| and your app is namespaced to App/ |