Skip to content

Instantly share code, notes, and snippets.

@davecra
davecra / detectMimeType.js
Created December 31, 2022 02:53
A JavaScript function to detect the Media/Mime Type for a base64 string
/**
* Returns the data type based on the base64 string
* @param {String} base64String
* @param {String} fileName
* @returns {String}
*/
detectMimeType(base64String, fileName) {
var ext = fileName.substring(fileName.lastIndexOf(".") + 1);
if (ext === undefined || ext === null || ext === "") ext = "bin";
ext = ext.toLowerCase();
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active January 21, 2025 12:52
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@mykeels
mykeels / ListNetworks.ino
Created February 26, 2019 13:18
Arduino -> ESP8266 Wifi Module program to list available WiFi networks
// See https://github.com/bportaluri/WiFiEsp
// See blog post https://medium.com/@mykeels/connect-to-wifi-with-arduino-9eee4b02d904
#include <WiFiEsp.h>
#ifndef HAVE_HWSERIAL1
#include <SoftwareSerial.h>
SoftwareSerial wSerial(6, 7);
#endif
void setup() {
@aidos-dev
aidos-dev / README.md
Last active January 21, 2025 12:48
How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

Step 1.

Open your terminal.

In the root directory run the command:

sudo nano /etc/bluetooth/main.conf
@ricardo-dlc
ricardo-dlc / README.md
Last active January 21, 2025 12:48
Update Jenkins Inside a Docker Container

First identify your image.

$ docker ps --format "{{.ID}}: {{.Image}} {{.Names}}"
3d2fb2ab2ca5: jenkins-docker jenkins-docker_1

Then login into the image as root.

$ docker container exec -u 0 -it jenkins-docker_1 /bin/bash
类别 药品通用名 原研品牌
抗生素类 头孢克洛 希刻劳
头孢呋辛 西力欣
左氧氟沙星 可乐必妥
莫西沙星 拜复乐
阿奇霉素 希舒美
头孢妥仑匹酯 美爱克
抗真菌类 盐酸特比萘芬 兰美抒
奥美拉唑 洛赛克
@shujisado
shujisado / osdn_mirror_contents_url.md
Last active January 21, 2025 12:46
OSDNのミラーコンテンツ 2023/11/19

OSDNのミラーコンテンツ 2023/11/19

OSDNでのリリースファイルやソースコードは全世界の25〜30箇所程の公開ミラーサイトへミラーリングされていた。 現時点ではどれだけ生存しているかは調べていないが、まだそれなりに生きているかと思われる。ただ、日本だとJAIST(ftp.jaist.ac.jp)とIIJ(ftp.iij.ad.jp)しかないようである。

リリースファイル:

OSDNではファイルの公開方法は二種類存在し、それぞれをファイルリリース、ファイルストレージと呼んでいた。前者は最初期からあるリリースシステムであり、後者はrsync等でも利用できる置き放題のストレージシステムである。

@sundowndev
sundowndev / GoogleDorking.md
Last active January 21, 2025 12:46
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@adambernier
adambernier / google_custom_search_up_to_100_results.py
Last active January 21, 2025 12:38
Return up to 100 results from the Google Search API. It increases the start parameter by 10 for each API call, handling the number of results to return automatically. For example, if you request 25 results the function will induce 3 API calls of: 10 results, 10 results, and 5 results.
# Background information:
# For instructions on how to set-up a Google Custom Search engine: https://stackoverflow.com/a/37084643/42346
# More detail about how to specify that it search the entire web here: https://stackoverflow.com/a/11206266/42346
from googleapiclient.discovery import build
from pprint import pprint as pp
import math
NUM_RESULTS = 25
MY_SEARCH = 'why do cats chase their own tails'

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com