Skip to content

Instantly share code, notes, and snippets.


Usman usmonster

  • Paris, New York, Internet
View GitHub Profile
usmonster /
Last active Nov 6, 2020 — forked from pierrejoubert73/
How to add a collapsible section in markdown.
1. Click to expand!


2. Click to expand!
  • One
  • Two
  • But also
usmonster / slack-messaging-rank.js
Created Sep 12, 2019
A little JS snippet you can run from the browser console of the Slack stats page to see the "true ranking" of top message senders
View slack-messaging-rank.js
// 1. go to https://{YOUR_SLACK_DOMAIN}
// 2. open the browser console
// 3. enter this (note: it might warn you that pasting code is bad):
$.post(`/api/team.stats.listUsers?_x_id=${boot_data.version_uid.slice(0,8)}-${Math.round(*100)/100}`, {
count: 50,
sort_prefix: 'chats_sent',
sort_dir: 'desc',
date_range: '30d',
set_active: true,
token: boot_data.api_token,
usmonster / textContent.js
Last active Aug 29, 2015 — forked from eligrey/textContent.js
Updated Node.prototype.textContent shim for IE8 ONLY
View textContent.js
(function() {
// inspired by Eli Grey's shim @
// heavily modified to better match the spec:
if (Object.defineProperty && Object.getOwnPropertyDescriptor &&
Object.getOwnPropertyDescriptor(Element.prototype, 'textContent') &&
!Object.getOwnPropertyDescriptor(Element.prototype, 'textContent').get) {
// NOTE: Neither of these "drop-in" patterns would work:
// Object.defineProperty(..., ..., descriptor); // nope!
usmonster / aight_textContent_test.html
Created May 22, 2014
tests for Element.prototype.textContent shim INCOMPLETE DRAFT
View aight_textContent_test.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<script type="text/javascript">
var log;
if ('console' in window && 'log' in window.console) {
log = function (x){ console.log(x); };
} else {
usmonster / aight_textContent_bug.html
Last active Aug 29, 2015
bug in aight's shim for Element.prototype.textContent
View aight_textContent_bug.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<script type="text/javascript">
function test() {
try {
var e = document.createElement('div');
e.innerHTML = '&nbsp;';
usmonster /
Last active Jan 4, 2016
Steps to export Vesuvius from LP to GH. Result here:
# Steps to export Vesuvius from LP to GH.
# Replace [username] and ~/path/to/vesuvius with the appropriate values.
# NOTE: This is NOT a script, but a series of commands you should run by hand.
# Also, much of this was found on .
# get the tools
sudo apt-get update
sudo apt-get install bzr-fastimport # adds fast-export to bzr if you don't already have it
sudo apt-get upgrade git # make sure git is the most current!
usmonster / ie8CssOutlineNoneBug.html
Last active Dec 25, 2015
The CSS rule `outline:none;` causes IE8 to barf when accessing a target element's `.currentStyle["outline"]` (or `.currentStyle["outlineWidth"]`). Fun! If you must, use instead `outline:0;` or `outline:none 0;`. (But really, [just avoid it](, okay?) (Note: this is fine when in a newer IE version but in "IE8 Standards m…
View ie8CssOutlineNoneBug.html
<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="utf-8" />
<div id="foo" style="outline:none;">Test</div>
<script language="javascript" type="text/javascript">
View browserpad
data:text/html, <html>
modified from
answer to
<style type="text/css">
usmonster / Posts.scala
Created May 15, 2012
Maybe we don't need to modify anything (signaturewise)? Maybe this is enough?
View Posts.scala
// ...
@Signature(parameters=Array("post_type", "subdomain", "group", "title", "body", "author"))
def create_post(post_type: String, subdomain: String, group: String, title:String = null, body:String, author:String) = wrap {
// not sure if this is efficient, but you get the idea
val CreatePost = post_type match {
case "short_post" => CreateShortPost(GroupRef(subdomain, group), body, UserRef(author))
case "long_post" => CreateLongPost(GroupRef(subdomain, group), title, body, UserRef(author))
// ... case else invalid