Skip to content

Instantly share code, notes, and snippets.

View AdamWagner's full-sized avatar

Adam Wagner AdamWagner

View GitHub Profile
@nkhil
nkhil / github.js
Created November 25, 2018 00:29
How to close a repo, work on it and upload it to Github as a different repo
// GitHub: git clone someone else's repository & git push to your own repository
// Create a new repository at github.com. (this is your repository)
// Give it the same name as the other repository.
// Don't initialize it with a README, .gitignore, or license.
// Clone the other repository to your local machine. (if you haven't done so already)
// git clone https://github.com/other-account/other-repository.git
// Rename the local repository's current 'origin' to 'upstream'.
@luruke
luruke / bunny.js
Created October 27, 2018 07:51
draw bunny on terminal
const drawille = require('drawille')
const bunny = require('bunny')
const glmatrix = require('gl-matrix')
const width = 200
const height = 200
const canvas = new drawille(width, height)
const mat4 = glmatrix.mat4
const vec3 = glmatrix.vec3
let points = []
{"title": "Mission control, elaborate",
"rules":[
{ "description": "Mission control, elaborate; requires Ctrl, Shft & arrows. Was created to make movements in Mission Control 'key-able', but works in all apps.",
"manipulators": [
{ "from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": ["control",
"shift"] } },
"to": [
// Unmap undesired defaults
const unmaps = [
"sb", "sw", "ob",
"ow", "cp", ";cp",
";ap", "spa", "spb",
"spd", "sps", "spc",
"spi", "sfr", "zQ",
"zz", "zR", "ab",
"Q", "q", "ag",
"af", ";s", "yp",
# Modified from https://github.com/alyssais configuration.
#
# The following configuration heavily leverages modal keymaps to minimize the
# pollution of global keybindings. In addition, the modal keymaps facilitate
# the consistent use of the same keybindings across different modes. For
# example, this configuration uses 'h', 'l', 'j', and 'k' to represent west,
# east, south, and north when: changing focus, warping windows, resizing
# windows, swapping windows, and moving floating windows. Those four keys are
# mapped differently depending on the current mode to provide a consistent user
# experience.
@TSFoster
TSFoster / script.js
Created March 22, 2018 01:15
Open files in existing neovim instance in iTerm
/*
Requirements:
* iTerm
* nvim
* nvr
Install:
1. New application in Automator
2. Add Run JavaScript action
@LukeSmithxyz
LukeSmithxyz / urlview.md
Last active May 30, 2023 13:27
Following Terminal Links with URLview

Following Terminal Links with URLview

Link handling

Specify what you want urlview to open your links with in ~/.urlview after COMMAND. I.e. the line below will make urlview open all urls in Firefox.

COMMAND firefox
@SamDudley
SamDudley / trelloBoardToText.js
Last active July 23, 2019 02:19
Alerts a markdown like text version of trello board's lists and cards.
// Helper function to convert node lists returned by querySelectorAll to an array
// so that we can used methods like map and filter.
function toArray(nodeList) {
let array = []
nodeList.forEach(node => array.push(node))
return array
}
// Returns a text (like markdown) representation of a trello board.
function trelloBoardAsText() {
@rik
rik / simulateTyping.js
Created September 1, 2017 14:30
Fake typing animation with async/await
async function nextFrame() {
return new Promise((resolve) => {
requestAnimationFrame(resolve)
})
}
async function randomDelay(min, max) {
const delay = Math.random() * (max - min) + min;
const startTime = performance.now()
while (performance.now() - startTime < delay) {
@RobTrew
RobTrew / JXA_PersistentProperties.js
Last active January 30, 2024 09:07
Persistent 'properties' for OS X JavaScript for Applications (JXA)
(function () {
'use strict';
// OSX JavaScript for Applications lacks the persistent 'properties'
// of AppleScript (in which global variables and properties persist between script runs)
// but we can, of course, serialise to JSON or plist at the end of a script
// parsing it at the start of the next run.
// Here is one approach to persistence between script runs
// using JSON.stringify() and JSON.parse()