Skip to content

Instantly share code, notes, and snippets.

@ByK95
ByK95 / svg.js
Created April 23, 2023 14:18
download svg from html svg view as document
const svg = document.getElementById('svg_null');
// Get the XML content of the SVG
const svgData = new XMLSerializer().serializeToString(svg);
// Create a new Blob object from the SVG data
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
// Create a new URL object from the Blob
const url = URL.createObjectURL(blob);
@ByK95
ByK95 / chain_and_class_attr.py
Created August 10, 2021 15:47
example of chaining and class attribute usage like drf
import functools
class Field(object):
def __init__(self, *args, **kwargs):
pass
class ChainAbleMixin(object):
def __getattr__(self, item):
@ByK95
ByK95 / dev_tools.py
Last active June 1, 2021 08:15
ipdb custom functionality wrapper
import sys
import types
import ipdb
"""
Functionality that monkey patches ipdb.set_trace method and allows
adding custom functions and etc for better debugging
usage:
define function and append to globals dictionary like
dictionary key should be unique
/*
Arduino 10k resistive termometer reading example
Circuit: 10k pullup
*/
void setup() {
Serial.begin(9600);
}
double Thermister(int RawADC) {
@ByK95
ByK95 / sampleREADME.md
Created March 25, 2020 16:14 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

@ByK95
ByK95 / app.js
Created January 27, 2020 11:11 — forked from pantharshit00/app.js
Simple express app using JWT authentication
/**
* To get started install
* express bodyparser jsonwebtoken express-jwt
* via npm
* command :-
* npm install express bodyparser jsonwebtoken express-jwt --save
*/
// Bringing all the dependencies in
const express = require('express');
@ByK95
ByK95 / index.html
Created January 23, 2020 09:50 — forked from jelmervdl/index.html
Pure Python & Flask server-side event source
<script>
var stream = new EventSource('/api/stream');
stream.onmessage = function(e) {
console.info(e.data);
};
</script>
@ByK95
ByK95 / gist:d18aeaa128d0a949d5cd31fc60c83388
Created November 25, 2019 14:28 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ByK95
ByK95 / gist:7c29ac50a4147ac37fe07cc878e96f52
Last active May 5, 2019 19:53 — forked from cfjedimaster/gist:3924728
Reveal.js events for slide navigation via mouse
window.addEventListener("mousedown", handleClick, false);
window.addEventListener("contextmenu", function(e) { e.preventDefault(); }, false);
//FIXME:disable this when user in ESC view
//TODO:check same for zoom view
function handleClick(e) {
e.preventDefault();
if(e.button === 0) Reveal.next();
if(e.button === 2) Reveal.prev();
}
@ByK95
ByK95 / fetch_file_fserver.py
Created April 9, 2019 18:38
Script that downloads file from server and pipes it to external program
# https://stackoverflow.com/questions/24562590/login-to-webpage-from-script-using-requests-and-django
import requests
import re
import datetime
import time
import subprocess
base_url = 'http://localhost:8000'
url_login= base_url +'/accounts/login/'