Skip to content

Instantly share code, notes, and snippets.

@codeanpeace
codeanpeace / app.js
Created December 7, 2022 22:29 — forked from cblavier/app.js
Responsive Phoenix LiveView
const Hooks = { ViewportResizeHooks}
const connectLiveSocket = () => {
const csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute('content')
const liveSocket = new LiveSocket('/my_app/live', Socket, {
params: {
_csrf_token: csrfToken,
viewport: {
width: window.innerWidth,
height: window.innerHeight
@codeanpeace
codeanpeace / soundcloudEmbedVolumeFix.js
Last active October 6, 2020 22:29 — forked from propagated/soundcloudEmbedVolumeFix.js
turn down the dang volume of embedded soundcloud iframes
//load soundcloud js api if needed
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://w.soundcloud.com/player/api.js';
document.head.appendChild(script);
//get the id of the player iframe or inject it using chrome
// var id = 'scplayer',
// widgetIframe = document.getElementById(id),

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@codeanpeace
codeanpeace / README.md
Last active December 30, 2015 12:59 — forked from JoelBesada/README.md

This is a command for Magicscroll Web Reader bookmarklet.