Skip to content

Instantly share code, notes, and snippets.

View talee's full-sized avatar

Thomas Lee talee

  • Mountain View, CA
View GitHub Profile
@talee
talee / fix-splunk-results.js
Created December 22, 2018 00:03
Fix Splunk not wrapping
(function() {
'use strict';
function resizeResults() {
var job = setTimeout(() => document.querySelectorAll('.events-results-table').forEach(el => (el.style.width = '100%') && el.offsetParent !== null && (clearTimeout(job) || console.log('Fixed Splunk wrapping'))), 2000);
}
setTimeout(() => document.querySelectorAll('[data-type=events]')[0].addEventListener('click', () => resizeResults()), 1000);
resizeResults();
window.resizeResults = resizeResults;
})();
@talee
talee / fix-splunk-results-wrapping.js
Last active April 17, 2018 00:43
Fix Splunk not wrapping results
javascript:(function(){var job = setTimeout(() => document.querySelectorAll('.events-results-table').forEach(el => (el.style.width = '100%') && clearTimeout(job)), 2000);})()
[
{
"name": "carrots",
"price": 50
},
{
"name": "onions",
"price": 30
},
{
@talee
talee / output-when-in-time-range.sh
Last active July 13, 2017 20:36
Shell: Output stuff if in time range
#!/bin/sh
read -r -d '' MAN <<'EOF'
Outputs custom strings when the current time is in a given time range.
ENV VARIABLES:
$TIME_RANGE_START
Epoch time
Example:
http://www.korgforums.com/forum/phpBB2/viewtopic.php?t=87030&sid=f447b05eafe84c1d93013b19ae285eab
Glossary for Korg Kronos
(shared)
ADC: Analog-to-Digital Converter
ADSR: ADSR envelope: Attack-Decay-Sustain-Release
Adv: Advanced (cf Basic)
.AIF and .AIFF: audio file format (cf .WAV)
AKR: After Key Release (a KARMA term)
@talee
talee / feature-branching.md
Last active November 1, 2016 01:30
Feature branching tips for friends
window.cardListHeight = _.debounce(function() {
const el = document.querySelector('.card-list');
el.style.height = `${document.documentElement.clientHeight - el.getBoundingClientRect().top}px`;
}, 300);
window.addEventListener('resize', function(){window.cardListHeight()});
@talee
talee / cdata-hyphen.console.js
Last active August 15, 2016 23:32
Hyphen in CDATA creates more nodes instead of a single text node.
(function(){var parser=new DOMParser();var expectedContent='hello-world';var result=parser.parseFromString('<div><![CDATA['+expectedContent+']]></div>','text/xml').firstChild.firstChild.data;if(result!=expectedContent)console.log('FAIL');else console.log('SUCCESS');console.log('result:',result);})()
#!/bin/sh
# First arg is referrer value
if [ $0 ]; then
REFERRER="-H 'Referer: $1'"
fi
cat urls.txt | xargs -I {} sh -c "curl -vksSL $REFERRER {} 2>&1 >/dev/null" | grep --color=none -E '(Connected|Referer|X-Frame-Options)'
@talee
talee / x-style-x-parse-fix.js
Created May 24, 2016 22:27
userscript to fix older x-style
document.registerElement('x-parse', {
prototype: {attachedCallback() {
let contentStyle = getComputedStyle(this)['content']
contentStyle != 'normal' ? alert(`x-parse content ${contentStyle}`) : 0
this.currentStyle = 'none'
}}
})