Skip to content

Instantly share code, notes, and snippets.

Xanir

  • Minnesota
Block or report user

Report or block Xanir

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Xanir
Xanir / twitch-chat-mark-as-read.js
Created Oct 15, 2019
Visually mark all messages previous to the clicked message as read
View twitch-chat-mark-as-read.js
var CLASS_CHAT_CONTAINER = 'chat-list__list-container';
var CLASS_CHAT_MESSAGE = 'chat-line__message';
var CLASS_MESSAGE_READ = 'chat-message-marked-as-read';
var styles = document.createElement('style');
styles.innerText = `
.chat-list__list-container .chat-line__message.${CLASS_MESSAGE_READ} {
opacity: 0.5;
View gist:abaad4b1d1e9250edfc6e2bc4b32bd95
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
<script>
var converter = new showdown.Converter();
converter.setOption('tables', true);
converter.setOption('simpleLineBreaks', true);
converter.setOption('emoji', true);
window.renderMarkdown = function() {
var markdownInput = document.querySelector('#markdownInput').value;
View Load Script Worker
var scriptId = 'api-base-path';
var scriptElem = document.querySelector('script#' + scriptId)
var scriptBlob = new Blob([scriptElem.innerText])
var scriptURL = URL.createObjectURL(scriptBlob)
var res = await fetch('worker.js');
var script = await res.text();
var scriptBlob = new Blob([script]);
@Xanir
Xanir / frameBuster.js
Last active Jan 4, 2019
Strip / Prevent IFrames
View frameBuster.js
if (!window.iframeBuster) {
var append = window.document.append;
window.document.append = function(node) {
if (node instanceof HTMLIFrameElement) {
console.log('blocked addition of iframe via append')
} else {
append.apply(apply, node);
}
};
View lift css
.lift-card {
background-color: peach;
}
.liftable {
padding: 0;
transition: padding 0.1s ease-in-out;
.lift-card {
margin-top: 0px;
@Xanir
Xanir / GroupedGet
Last active Apr 25, 2017
GroupedGet
View GroupedGet
var GroupedGet = function(getterFn, massGetterFn) {
var thisGroupService = this;
thisGroupService._items = {};
thisGroupService._pendingItems = {};
thisGroupService._singleGet = getterFn;
thisGroupService._massGet = massGetterFn;
thisGroupService.sendMassGet = thisGroupService.sendMassGet.bind(this);
View labeled-value.css
.label-value-group {
display: table;
margin: 0 2rem;
border-collapse: separate;
border-spacing: 0 1em;
}
.label-value-pair {
display: table-row;
@Xanir
Xanir / Dockerfile
Created Mar 21, 2017
Terraria Dockerfile
View Dockerfile
FROM ubuntu:16.10
# Download and install TShock
ENV TSHOCK_VERSION=4.3.23 \
TSHOCK_FILE_POSTFIX=""
# Add mono repository
# Update and install mono and a zip utility
# fix for favorites.json error
@Xanir
Xanir / Dockerfile
Created Mar 18, 2017
7Days to Die Docker Image
View Dockerfile
FROM ubuntu:16.10
RUN apt-get update && \
apt-get upgrade && \
apt-get install -y curl lib32gcc1 && \
mkdir /var/steam && \
cd /var/steam && \
curl -sqL http://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar zxvf -
View gist:048aa3357d708aaa6a7a60016d957e57
.footnote-index {
font-size: 0.6em;
vertical-align: super
}
ol.footnote-details {
counter-reset:li; /* Initiate a counter */
margin-left:0; /* Remove the default left margin */
padding-left:0; /* Remove the default left padding */
You can’t perform that action at this time.