Skip to content

Instantly share code, notes, and snippets.

@stefanmaric
stefanmaric / copy-to-clipboard-bookmarklet.md
Created September 7, 2016 20:54
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard

Copy-to-clipboard Bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
@danharper
danharper / background.js
Last active June 29, 2024 19:32
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@lenada
lenada / gist:4012862
Created November 4, 2012 18:21
Installing OwnCloud on FreeNAS 8.3

FreeNAS "plugin" OwnCloud

see http://doc.freenas.org/index.php/Plugins get pluginjail running

create a folder / zfs filesystem on a device with sufficient storage space. mount_nullfs created directory to /plugin-jail-path/usr/ports

portsnap fetch portsnap extract