Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ ! -f package.json ]; then
# Default to npm regardless of missing package file.
echo "npm"
exit 0
fi
NODE_VERSION=$(node --version)
NODE_VERSION="${NODE_VERSION%%\.*}"
@ih2502mk
ih2502mk / list.md
Last active June 2, 2024 17:53
Quantopian Lectures Saved
import sys
from PyQt5.QtCore import QUrl, QSize
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineScript, QWebEnginePage, QWebEngineProfile
from PyQt5.QtWidgets import QToolBar, QAction, QLineEdit, QLabel, QMainWindow, QTabWidget, QApplication
from PyQt5.QtNetwork import QNetworkCookie
import http.cookiejar
def create_script(name, src, injection_point = QWebEngineScript.DocumentCreation, world = QWebEngineScript.MainWorld, on_subframes = True):
script = QWebEngineScript()
script.setSourceCode(src)
@crittermike
crittermike / chmod.md
Last active June 2, 2024 17:50
How to chmod only directories

Use chmod +X (as opposed to +x) which will make only directories executable and leave files alone.

This is great for recursively fixing a Drupal files directory. For example:

chmod -R 664 sites/default/files && chmod -R a+X sites/default/files

That will make all your files writeable by you and the server, but not executable, but will also make directories executable (i.e., listable).

@itsChris
itsChris / Speedtest CLI by Ookla.md
Created January 4, 2021 08:25
Speedtest CLI by Ookla
<title>Speedtest CLI by Ookla</title>
@fedir
fedir / .gitignore
Last active June 2, 2024 17:50 — forked from Avinashachu007/.gitignore
.gitignore for Java, Maven, Spring Boot - Eclipse, Netbeans, IntelliJ IDEA, Visual Studio Code
/target/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
@nondebug
nondebug / known_gamepads.txt
Last active June 2, 2024 17:49
A list of vendor and product IDs for known USB and Bluetooth gamepad devices
0000:006f JessTechColourRumblePad
0001:0329 Sl6566
0005:05ac Mocute
0010:0082 AkishopCustomsPs360Plus
0078:0006 MicrontekUsbJoystick
0079:0006 PcTwinShock
0079:0011 DragonRiseGamepad
0079:1800 MayflashWiiUProAdapter
0079:181a VenomLimitedArcadeJoystick
0079:181b VenomArcadeJoystick
@Asjas
Asjas / reset.css
Created May 19, 2021 07:09
Modern CSS Reset - Andy Bell
// https://piccalil.li/blog/a-modern-css-reset
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
@kemadz
kemadz / ebk2sel.py
Last active June 2, 2024 17:46
通达信,同花顺板块导出文件转换
#!/usr/bin/python
# -*- coding: utf-8 -*-
import struct
'''
同花顺自选股文件格式
0000000: 0900 0721 3030 3039 3731 0711 3630 3036 ...!000971..6006
0000010: 3738 0721 3030 3231 3134 0721 3030 3232 78.!002114.!0022
@e7d
e7d / remove-obsolete-gpg-key-from-dnf.md
Last active June 2, 2024 17:46
Remove obsolete GPG key from DNF (Fedora)