Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@KacperKozak
KacperKozak / ctrl-enter.js
Last active April 23, 2024 09:06
[Ctrl] + [Enter] to submit forms
document.body.addEventListener('keydown', (event) => {
if(event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
event.target.form?.submit();
}
});
@avishayp
avishayp / Dockerfile
Created September 25, 2018 19:02
Add non-root user for alpine linux
# non root user example for alpine
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM alpine
ARG USER=default
ENV HOME /home/$USER
@firexcy
firexcy / readme.md
Last active April 23, 2024 09:06
DIY a Rewind.ai

This Gist provides a solution to periodically capture screenshots of your Mac, and create therefrom a searchable PDF archive so that you can always get an answer to the “what, when, and where” questions about your usages.

To use these scripts:

  1. Download the shell script rewind, then:
    1. put it under ~/bin (or other fixed path you prefer);
    2. execute
@iamravenous
iamravenous / jquery.smooth-scroll-pageload.js
Last active April 23, 2024 09:05
Smooth scrolling on page load if URL have a hash
/*
* Smooth Scroll on Pageload
* Smooth scrolling on page load if URL have a hash
* Author: Franco Moya - @iamravenous
*/
if (window.location.hash) {
var hash = window.location.hash;
if ($(hash).length) {
@lokhman
lokhman / ubuntu-hardening.md
Last active April 23, 2024 09:05
List of things for hardening Ubuntu

WARNING

May contain out of date information. Check the comments below!

The list of actions listed below was taken mostly from Book Of Zeus with minor modifications and did the job well for Ubuntu version, which was available at that moment (May 2016). This gist was created for internal use and was never meant to be discovered by the web, although Google managed to find and index this page, which was a great surprise for me. Please check the original source for the updated information (links are provided in most of the sections), and read the comments below: they provide more details about the usage experience.

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

@valeriansaliou
valeriansaliou / routeros_configuration_orange.txt
Last active April 23, 2024 09:02
RouterOS / MikroTik router configuration export to connect to the Orange/Sosh Livebox 4 fiber ONT (IPv4 + IPv6)
# jan/13/2020 08:34:56 by RouterOS 6.46.1
#
# notes: \
# - wan to orange ont on ether1; \
# - lan to ap/switch on ether2; \
# - ipv4 + ipv6 w/ fw rules; \
# - using routeros dns cache for lan, proxying to the dns servers advertised by orange's dhcpv4 server; \
# - direct plug your computer w/ wireshark to your livebox 4 fiber ethernet port and reboot it, inspect the dhcpv4 packat in wireshark and extract the value of 'authsend'; \
# - the cos tag needs to be set to 6 to be accepted by the ont dhcpv4/v6 server (from default 0), this may not be required depending on your ont, check for the cos flag sent by your livebox 4 when sniffing its traffic
#
@sindresorhus
sindresorhus / esm-package.md
Last active April 23, 2024 09:02
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@huazhanshen
huazhanshen / BT 磁力搜索引擎索引
Created May 30, 2018 05:39
BT 磁力搜索引擎索引
btkitty
知名的BT磁力搜索,资源很多
http://cnbtkitty.com/
备用域名:http://btkitty.fyi/
idope.se
资源丰富的BT磁力搜索,并且大多数速度下载速度很快
https://idope.se/
@jdhao
jdhao / Sublime_text_regex_cheat_sheet.md
Last active April 23, 2024 08:58
Sublime Text regular expression cheat sheet, you can also find it in https://jdhao.github.io/2019/02/28/sublime_text_regex_cheat_sheet/

Special characters

expression Description
. Match any character
^ Match line begin
$ Match line end
* Match previous RE 0 or more times greedily
*? Match previous RE 0 or more times non-greedily
+ Match previous RE 1 or more times greedily