Skip to content

Instantly share code, notes, and snippets.

@4skinSkywalker
4skinSkywalker / VPVR.pine
Last active September 26, 2025 00:46
Volume Profile Visible Range in Pine Script
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Fr3d0C0rl30n3
//@version=4
study("Fr3d0's Volume Profile Visible Range", "VPVR", overlay=true, max_boxes_count=500)
DEFAULT_COLOR = color.new(color.gray, 0)
BORDER_COLOR = color.new(color.black, 80)
BUY_COLOR = color.new(color.green, 0)
SELL_COLOR = color.new(color.red, 0)
@davidhariri
davidhariri / jwt-apple-signin.py
Created October 12, 2019 18:14
Code required to verify Sign in with app-made Apple JWT tokens server-side in Python
import jwt
from jwt.algorithms import RSAAlgorithm
import requests
from time import time
import json
import os
APPLE_PUBLIC_KEY_URL = "https://appleid.apple.com/auth/keys"
APPLE_PUBLIC_KEY = None
@legkvla
legkvla / filling.cljs
Created June 4, 2018 07:24
Vertical div filling in html (cljs)
[:div.col-md-offset-3.col-md-5
[:p {:style {:height "calc(100vh - 100px)"}} "Going to fill it in"]
[:p "This is footer"]
]
@tkachenko1503
tkachenko1503 / why-do-we-need-types-in-javascript.md
Last active April 21, 2020 10:35
Do we need types in JavaScript? Or maybe not?

This is my lightning talk submission to ReactiveConf 2018 https://reactiveconf.com/

In this talk, I want to share my experience gained during the development of frontend applications in several programming languages.

I think it's not a secret for anybody that developing large JavaScript applications is not so easy as it seems at first glance. We all want something simpler and more reliable. Therefore, many developers and even entire companies switch to different, compiled in JavaScript, programming languages. The bulk of such transitions is accounted for TypeScript and flow, and often, developers faced with more problems than they were before.

I wasn't the exception. Moving to a new project, I started using TypeScript and was disappointed. Luckily in my next project I used ClojureScript and it was like everything is illuminated!

@pesterhazy
pesterhazy / re-natal-error-handling.cljs
Created September 4, 2017 21:44
Re-natal, reagent, react native error handling improved
;; Unfortunately, re-natal's stacktraces are not always great.
;;
;; The following two functions (downgrade-reagent-errors and set-error-handler)
;; give you better error messages in the Debug console (accessible in XCode
;; or using `react-native log-ios`).
;;
;; This should apply mutatis mutandis to Android.
(defonce !handler-set (atom false))
@mosquito
mosquito / README.md
Last active October 14, 2025 19:22
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@studiotomi
studiotomi / ps-snapshot.sh
Created February 7, 2017 16:33
Back up postgres db to google cloud storage
#!/bin/bash
# Requirements:
# - gcloud/gsutil is installed on the box
# - gcloud is logged in as a user with write access to Google Cloud Storage
# - The file has execution rights so that it can be run in cron
# - The Google Cloud Storage bucket already exits
# Exit on any error
set -e
<script>
function OpenInNewTab() {
var screenwidth = screen.width-500;
window.open("http://m.me/fiercelycurious", '_blank',"width=500,height=800,left="+screenwidth);
}
</script>
<a href="http://m.me/fiercelycurious" target="_blank" onclick="OpenInNewTab();"> <!-- m.me/facebookpage works for any facebook page -->
<div class="fbmessenger">
;; Auto-scrolling ==============================================================
(defn scroll! [el start end time]
(.play (goog.fx.dom.Scroll. el (clj->js start) (clj->js end) time)))
(defn scrolled-to-end? [el tolerance]
;; at-end?: element.scrollHeight - element.scrollTop === element.clientHeight
(> tolerance (- (.-scrollHeight el) (.-scrollTop el) (.-clientHeight el))))
(defn autoscroll-list [{:keys [children class scroll?] :as opts}]
@mmcdaris
mmcdaris / airbrake-curl.md
Last active November 6, 2020 13:06
Airbrake example error with curl!

Want to curl an Airbrake test exception?

If you want to curl an error to the Airbrake error capturing service you have come to the right place! This is based off the API doc for create notice. There are more details there ;) https://airbrake.io/docs/#create-notice-v3

Just curl the json with the following command:

curl -X POST -H "Content-Type: application/json" -d @error.json "https://airbrake.io/api/v3/projects/PROJECT_ID/notices?key=PROJECT_KEY"