Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Emerson joshje

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am joshje on github.
  • I am joshje (https://keybase.io/joshje) on keybase.
  • I have a public key ASDCnV5pterqvlBYRNzpVFNwU1ov27u0PY1_HhnenBFcgQo

To claim this, I am signing this object:

View update-intercom-company.js
const intercomClient = new require('intercom-client').Client({appId:"he1f413x" ,appApiKey: "************"});
intercomClient.companies.create({ company_id: '636e7949-f0ac-4b73-bedf-ba8204205714', custom_attributes: { plan:"STARTER_ANNUAL", trial_ended: true } }, function (r) { console.log(r); });
@joshje
joshje / styles.less
Created Jul 6, 2016
Atom editor custom stylesheet
View styles.less
// Make close icons always visible
.tab-bar .tab,
.tab-bar .tab.active {
.title {
padding-right: 20px;
}
.close-icon {
transform: scale(1);
View keybase.md

Keybase proof

I hereby claim:

  • I am joshje on github.
  • I am joshje (https://keybase.io/joshje) on keybase.
  • I have a public key whose fingerprint is 3224 62D2 9BFD 69ED 9312 2D02 4A47 F6D0 7BB0 495D

To claim this, I am signing this object:

@joshje
joshje / netmag-wordcount.js
Last active Aug 29, 2015
Word counter for net magazine article submissions (1 line of code = 10 lines). Uses <pre> tags in the page to determine code blocks.
View netmag-wordcount.js
(function() {
var codeBlocks = document.getElementsByTagName('pre'),
codeLines = 0,
body = document.getElementsByTagName('body')[0],
text = function(el) {
if (el.innerText) return el.innerText;
return el.textContent;
};
var wordCount = text(body).split(' ').length;
View ikealist.js
(function() {
var l = document.querySelectorAll('.prodInfoContainer a');
for (i=0; i<l.length; i++) {
s = document.createElement('span');
s.innerHTML = l[i].href.replace(/[^0-9]/,'') + '<br>';
l[i].appendChild(s);
}
}();
@joshje
joshje / fontloading.html
Created Oct 30, 2012
Load Fontdeck fonts asynchronously with hidden text timeout
View fontloading.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script>
function async(url) {
var a = document.createElement('script');
a.async = true;
a.src = url;
var b = document.getElementsByTagName('script')[0];
@joshje
joshje / supportsFFS.html
Created Jun 21, 2012
CSS font-feature-settings support detection
View supportsFFS.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Opentype Test</title>
<style>
span.opentype-test {
font-family: Corbel;
font-size: 100px;
position: absolute;
@joshje
joshje / reveal-titles.js
Created Apr 30, 2012
Reveal title attribute within innerHTML of time elements
View reveal-titles.js
// Uncompressed:
(function() {
var els = document.querySelectorAll('[title]');
for (var i=0,len=els.length;i<len;++i) {
var el = els[i];
if (el.title!='') {
el.innerHTML+=' <span style="background:#EEE;color:#333;padding:2px;font-weight:normal;font-style:normal">'+el.title+'</span>';
el.removeAttribute('title');
}
}
@joshje
joshje / async
Created Jan 10, 2012
Asyncronously load javascript by passing in a URL
View async
function async(url) {
var a = document.createElement('script');
a.async = true;
a.src = url;
var b = document.getElementsByTagName('script')[0];
b.parentNode.insertBefore(a, b);
}