Skip to content

Instantly share code, notes, and snippets.

View kalupa's full-sized avatar

Paul Kalupnieks kalupa

View GitHub Profile
@kalupa
kalupa / code-review.ts
Last active September 20, 2022 20:04 — forked from tavisrudd/agenda.md
////////////////////////////////////////////////////////////////////////
// 1.1) If you saw something like this during a code review
// what would you say and how would you improve it?
// (If you don't know Typescript's type system well, pseudo-code it or talk about a typed language you know well.)
type Shape = {
type: "circle" | "square";
size: number;
radius: number;
};
@kalupa
kalupa / cloudSettings
Last active November 19, 2018 18:05
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-11-19T18:05:20.338Z","extensionVersion":"v3.2.0"}
@kalupa
kalupa / add-lang-attr.js.html
Created August 16, 2017 22:17
Adds lang and xml:lang to html node.
<script type='text/javascript'>
var targetLang = "en";
var htmlEl = document.querySelector('html');
htmlEl.lang = targetLang;
htmlEl.setAttribute("xml:lang", targetLang);
</script>
@kalupa
kalupa / kaluPlanck.kbd.json
Last active August 3, 2017 14:06
kaluPlanck
[
{
"name": "kaluPlanck",
"author": "Paul Kalupnieks",
"switchMount": "cherry",
"switchBrand": "cherry",
"switchType": "MX1A-C1xx",
"plate": true
},
[
@kalupa
kalupa / ie8-polyfill.js
Last active April 11, 2017 20:59
Fix Unbounce forms in IE8
(function() {
if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
var k=[],p;
for (p in o) if (Object.prototype.hasOwnProperty.call(o,p)) k.push(p);
return k;
}
@kalupa
kalupa / facebookformfill.md
Last active April 19, 2016 16:25 — forked from johnnyopao/facebookformfill.md
Fill your Unbounce Forms using Facebook data
@kalupa
kalupa / ternaryhate.js
Created July 1, 2014 22:42
Why I don't like ternaries
var borderStyle = borderApply ?
(borderApply.top === borderApply.left && borderApply.left === borderApply.bottom && borderApply.bottom === borderApply.right) ?
borderApply.top ? value.style : 'none' :
[
borderApply.top ? value.style : 'none',
borderApply.right ? value.style : 'none',
borderApply.bottom ? value.style : 'none',
borderApply.left ? value.style : 'none'
].join(' ') : value === null ? 'none' : value.style;
-----BEGIN PGP MESSAGE-----
Version: Keybase OpenPGP v0.1.12
Comment: https://keybase.io/crypto
wcBMAwoLYt/gi5XxAQf/SBskAVcnIQvEZD8sZ2vL3Wd7a3Uv3McknVculfcPt+H/
4uU5XSGLCF9mC4g0WJZ88n3RICssQISE/h6066puIK4jAW3TWoqzXIDJgZEOwa8o
pStSV9ZrqMB2E8q+w0CNCNmaULlmv14b69DHCgX4y8cKRf0sXxU8b0jMQf2aJdoR
aQNESlqmUvIUdDtSMQO6fxQKC41YXmKs0XqFDLuRnzirNshD3Aq8S28JbMVIFy18
LkbtBa3Hu5apiXqMDT/FM+zLJGLWoxM+a2h741WtGuDmlFPkYC4wXWJVBNNcPL51
77oYVxPNXllHdLCqg/w/YX92RfMEieK62CRQkfaW9tLADAGPxKUa9fr2l20/bmdd
@kalupa
kalupa / keybase.md
Created March 26, 2014 22:44
Keybase proof

Keybase proof

I hereby claim:

  • I am kalupa on github.
  • I am kalupa (https://keybase.io/kalupa) on keybase.
  • I have a public key whose fingerprint is 6A22 7177 4E4B 67EA EBF7 DC75 0D0E 627C E0EF BC0A

To claim this, I am signing this object:

@kalupa
kalupa / Gemfile
Created March 18, 2014 20:50
Sub-folder rspec
# rails-app/Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.17'
gem 'aws-sdk'
gem 'crack', '~> 0.3.2'
gem 'haml-rails'
gem 'mysql2', '~> 0.3.11'
gem 'json'