Skip to content

Instantly share code, notes, and snippets.

@rosco-pc
rosco-pc / unifi.md
Last active March 17, 2025 14:26
Unifi commands.md

Unifi AP useful commands

using SSH:

  • log in to AP: $ ssh ubnt@<IP>
  • default username & password: ubnt & ubnt

Generic

Command Example Function

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at [email protected] or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

// interviewer: what will the following code output?
const arr = [10, 12, 15, 21];
for (var i = 0; i < arr.length; i++) {
setTimeout(function() {
console.log('Index: ' + i + ', element: ' + arr[i]);
}, 3000);
}
@veganista
veganista / file.liquid
Created April 20, 2016 10:56
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>
@paulirish
paulirish / bling.js
Last active February 18, 2025 14:08
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@addyosmani
addyosmani / README.md
Last active March 24, 2025 17:35 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@staltz
staltz / introrx.md
Last active April 1, 2025 06:30
The introduction to Reactive Programming you've been missing
#!/bin/bash
#This script generates one export for each year of a Tilemill project to mbtiles format
#Instructions:
#Run using 'bash tilemill-export.sh [project-name]'
#For more info: http://flipside.org/notes/scripted-tilemill-export
#Assumptions
# - stylesheet = style.mss
@hipertracker
hipertracker / meteor-async-example.js
Last active January 1, 2016 00:09
Meteor with (1) Npm and Async tools, (2) q.js promises
// feature: blocking and server side only
// uses: https://github.com/arunoda/meteor-npm
// install: mrt add npm
blockingRequest = function (verb, url, data) {
return Async.runSync(function (done) {
HTTP.call(verb, url, data, function (error, result) {
done(error, result);
});
});
};