Skip to content

Instantly share code, notes, and snippets.

View AGresvig's full-sized avatar

Aksel G. Gresvig AGresvig

View GitHub Profile
@AGresvig
AGresvig / scroller.js
Last active August 29, 2015 14:14 — forked from Eyal-Shalev/scroller.js
Forked for Node compatibility
'use strict';
/*
* Based on work done by Nikhil Nigade (@dezinezync) https://gist.github.com/dezinezync/5487119
*/
var DEFAULT_ELEMENT = document.documentElement.scrollTop ? document.documentElement : document.body;
var REQUEST_ANIMATION_FRAME = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame || window.oRequestAnimationFrame;
@AGresvig
AGresvig / scroll.easing.js
Last active August 29, 2015 14:14 — forked from dezinezync/scroll.easing.js
NPM compat version
var scroller = module.exports = {
scrollTo(Y, duration, easingFunction, callback) {
var start = Date.now(),
elem = document.documentElement.scrollTop?document.documentElement:document.body,
from = elem.scrollTop;
if(from === Y) {
callback();
return; /* Prevent scrolling to the Y point if already there */
@AGresvig
AGresvig / slackstatus.sh
Last active June 5, 2018 12:47
A command line utility for changing your Slack status.
#!/bin/bash
# Usage: slackstatus "My new status"
function slackstatus() {
slacktoken=$SLACK_OAUTH_TOKEN
apiurl="https://slack.com/api/users.profile.set?token="$slacktoken"&profile="
emoji=":mag:"
if [ $# -eq 0 ]