Skip to content

Instantly share code, notes, and snippets.

Avatar

Aksel G. Gresvig AGresvig

View GitHub Profile
@AGresvig
AGresvig / slackstatus.sh
Last active Jun 5, 2018 — forked from samervin/slackstatus.sh
A command line utility for changing your Slack status.
View slackstatus.sh
#!/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 ]
@AGresvig
AGresvig / scroll.easing.js
Last active Aug 29, 2015 — forked from dezinezync/scroll.easing.js
NPM compat version
View scroll.easing.js
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 / scroller.js
Last active Aug 29, 2015 — forked from Eyal-Shalev/scroller.js
Forked for Node compatibility
View scroller.js
'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;