Skip to content

Instantly share code, notes, and snippets.

@jkulton
jkulton / gist:99a21a007636a1b1bf598912d7b3899f
Created January 19, 2017 03:38
Boolean for whether user is on Twitter for iPhone webview
var isIphoneTwitterAgent = navigator.userAgent.indexOf('Twitter for iPhone') > -1;
@jkulton
jkulton / rom_to_int.rb
Created May 17, 2017 23:47
Roman Numeral to int
def rom_to_int(input, total=0)
return total if input.length === 0
roman_numerals = {
"I" => 1,
"V" => 5,
"X" => 10,
"L" => 50,
"C" => 100,
"D" => 500,
### Keybase proof
I hereby claim:
* I am jkulton on github.
* I am jkulton (https://keybase.io/jkulton) on keybase.
* I have a public key ASARqye7F3RcM3xWL3MJq92JIvBhq1yI97B9dxsJ6lRsRAo
To claim this, I am signing this object:
@jkulton
jkulton / HOME.md
Last active February 5, 2022 05:44
Gistdoc

Gistdoc

Quickly view GitHub markdown gists as simple blog-style pages[^1].

How to use

  1. Go to any GitHub gist with at least one markdown file
  2. Change the domain in your browser from gist.github.com to gistdoc.com[^2]
  3. Hit enter
  4. 🎉
@jkulton
jkulton / CHANGELOG.md
Last active September 6, 2023 22:03
Gistdoc Changelog

changelog banner

Gistdoc Changelog

Sep 6, 2023

Jul 12, 2022

@jkulton
jkulton / index.html
Last active August 24, 2022 02:45
callback example
<html>
<body>
<script>
class FakeXMLHttpRequest {
constructor() {
this.events = [];
}
open() {}
@jkulton
jkulton / POST.md
Last active February 5, 2022 05:44
Gistdoc Updates

Gistdoc Updates

Comments

Gist comments now appear at the bottom of a Gistdoc page along with a link to comment on the gist on GitHub.

comments on gistdoc page

Dark Mode

@jkulton
jkulton / README.md
Last active August 24, 2022 02:45
Terraform Import/Export

Terraform Import/Export

If you need to move resources between Terraform projects but they aren't configured in such a way you can directly run tf state move to move them between modules you can follow this process for migrating resources between terraform projects.

Commands Used

@jkulton
jkulton / swindle.js
Created February 24, 2022 02:47
Swindle
(function() {
if (window.Swindle !== undefined) return;
function Swindle({
embedElementParam = 'swindle_embed',
embedURLParam = 'swindle_url',
imgStyles = { maxWidth: '100%' }
} = {}) {
// Applies an object of styles to an HTML element
function applyStyles(element, styles) {
@jkulton
jkulton / README.md
Last active August 24, 2022 02:44
Useful Web Resources

Useful Web Resources

HTML/CSS

  • MDN Web Docs — Owned by Mozilla. A great resource for basically all the topics in this list. This is probably the single most useful site on this list.
  • Can I use — Tool for determining whether a specific browser supports specific HTML/CSS/JavaScript features
  • CodePen — Useful site for writing HTML/CSS/JavaScript directly in the browser and seeing it rendered.
  • HTML, CSS validators
  • "wtf is a validator?" — For compiled languages like Java, C/++, etc. you don't need one of these because your code gets validated when you build. HTML/CSS aren't programming languages, they are markup/stylesheet languages which don't have a build step so they will attempt to run even if they aren't "valid". Many (most?) professors will make you scan your HTML/CSS with a validator to make sure