Skip to content

Instantly share code, notes, and snippets.

View derpycoder's full-sized avatar
🚧
Working on DerpyTools

Abhijit Kar ツ derpycoder

🚧
Working on DerpyTools
View GitHub Profile
@derpycoder
derpycoder / modify-what-differs.js
Last active December 20, 2017 03:20
Apply changes from one object to another if they differ.
// Configs
var origConfig = {
p: {
a: 23,
b: 92,
c: {
num: 1
}
},
q: {
@derpycoder
derpycoder / access-deep-props.js
Last active March 4, 2020 13:51
Accessing Deep Properties from Objects
var obj = {
x: {
p: [
{
q: [
"Foo Bar"
]
}
]
}
@derpycoder
derpycoder / standard-environment
Last active March 1, 2018 11:17
Price Optimized setting for Standard Environment of Google Cloud Platform
runtime: go
api_version: go1.8
basic_scaling:
max_instances: 1
idle_timeout: 10m
@derpycoder
derpycoder / Flexible Environment
Created March 1, 2018 11:25
Price Optimization for Flexible Environment of Google Cloud Platform
runtime: nodejs
env: flex
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
@derpycoder
derpycoder / blueprint.svg
Last active March 18, 2020 10:37
CSS Pattern Background & Pan Using Mouse
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@derpycoder
derpycoder / precompute-spring-css.js
Last active September 24, 2021 23:09
CSS Spring Animation Precompute
/**
* Taken From:
* Article: https://medium.com/@dtinth/spring-animation-in-css-2039de6e1a03
* By: Thai Pangsakulyanont
*/
function spring(t) {
return -0.5 * (2.71828 ** (-6 * t)) * (
-2 * (2.71828 ** (6 * t)) + Math.sin(12 * t) + 2 * Math.cos(12 * t));
}
@derpycoder
derpycoder / pop-up.js
Last active September 30, 2022 05:57
Opens a Pop Up & Closes it when it matches a route URL!
const POP_UP_URL = "/"
const TARGET_URL = window.location.origin
const TARGET_URL_REGEX = new RegExp(TARGET_URL)
const POP_UP_WINDOW = open(POP_UP_URL, "Pop Up Window", `scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=512,height=512`);
const onPopUpClose = () => {
console.log("Pop Up Closed")
}
// Watch if Pop Up closed, repeatedly, as onclose callback doesn't work for pop ups!
@derpycoder
derpycoder / cookie-consent.js
Last active January 16, 2023 18:11
Cookie Consent Snippet
@derpycoder
derpycoder / cookie-settings.html
Created January 16, 2023 18:08
Cookie Setting Button to Invoke Cookie Consent Banner
@derpycoder
derpycoder / index.html
Created January 16, 2023 18:10
Iframe Manager Config to Rick Roll by hiding the thumbnail.
<div
data-service="youtube"
data-id="dQw4w9WgXcQ"
data-thumbnail=""
data-title="Totally not a Rick Roll"
data-iframe-loading="lazy"
></div>