Skip to content

Instantly share code, notes, and snippets.

@genadyp
genadyp / javascript-useful-links.md
Last active May 10, 2024 00:30
javascript (js) useful links
@Zeokat
Zeokat / gist:3b5c1273a7da48e1ad94
Created August 30, 2014 01:47
/etc/apache2/apache2.conf
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
<!-- Add this to the Head section of your super site -->
<script>
// Say we host our Super site in a subdirectory e.g. https://example.com/blog
// We can redirect it properly in Cloudflare Worker, but relative links will break
// So we require some custom code to override absolute href paths & history state changes
if (window.location.origin === 'https://example.com') {
var baseDir = '/blog';
function historyMethodOverride(target, thisArg, argArray) {
// prepend baseDir if it isn't there
@tomnk
tomnk / javascriptLodashUnderscore.md
Created October 22, 2018 16:12
102120254: Javascript You don't (may not) know Lodash/Underscore

You don't (may not) know Lodash/Underscore

In response to You-Dont-Need-Lodash-Underscore made by @cht8687, yes some of the methods could be replaced by native methods. This is not the case when things get a bit more complex. According to the Lodash author, @jdalton:

If you're only using a handful of methods on arrays and don't care about nullish guards, object iteration, smoothing over enviro/ES5/ES6 issues, FP goodies, iteratee shorthands, lazy evaluation, or other enhancements then built-ins are the way to go. Folks who use lodash know its 270+ modules work great combo'ed with ES6, enabling cleaner code and empowering beyond built-ins.

ESLint?

There is a plugin

@todgru
todgru / get.js
Created May 21, 2020 22:01
vanilla javascript version of lodash get
/**
* The behaves the same as the lodash version https://www.npmjs.com/package/lodash.get
*
* Source: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get
*/
const get = (obj, path, defaultValue = undefined) => {
const travel = regexp =>
String.prototype.split
.call(path, regexp)
.filter(Boolean)
@txhammer68
txhammer68 / linux.md
Last active May 10, 2024 00:28
Linux Tips

Linux Tips (Debian Based distros)

Some usefull tips i have collected over the years, use at own risk.

  • Users & Groups

    • Add user to group
      sudo usermod -a -G cdrom userName
      sudo usermod -aG vboxsf $USER
  • Change root password
    sudo passwd root

@cemerson
cemerson / archive.org-scanned-book-downloader-bookmarklet.md
Last active May 10, 2024 00:26
Archive.org Scanned Book Downloader Bookmarklet

Archive.org Scanned Book Downloader Bookmarklet

A simple "1-click" javascript approach to downloading a scanned book from archive.org to read at your leisure on the device of your choosing w/out having to manually screenshot every pages of the book by hand. In short it's a glorified "Save Image As..." approach but consolidated down to "1 click". BTW there may be a much better option than this out there - I just built this as an autistic project to see if it would work.

Demo Video

Archive.org SBDL Demo

Obligatory Legal/Disclaimer:

By using this script you agree to delete all book files/images after your 1 hour or 14 days is up! I don't support using this script for any other use cases. After all, none of us have ever kept a library book past it's return date, right?

@nh2
nh2 / tcp-nodelay.md
Last active May 10, 2024 00:24
Understanding TCP_NODELAY

I believe the following is the best way to work with Nagle's algorithm / TCP_NODELAY / TCP_CORK.

It is described in this RedHat manual and the verdict is:

  • Set TCP_NODELAY = 1, always.
  • If you can batch data for sending by creating a buffer manually, or using writev(), prefer that.
  • If you cannot (e.g. "when using different libraries that provides abstractions for layers" from the above manual):
    • Set TCP_CORK = 1, then write the data, then set TCP_CORK = 0.
  • This builds a packet in kernel space and then flushes it out.
@pablotolentino
pablotolentino / Visual Studio 2022 Product Key
Created November 20, 2021 20:41
Visual Studio 2022 Enterprise Product key
Visual Studio 2022
Enterprise :
VHF9H-NXBBB-638P6-6JHCY-88JWH
Professional:
TD244-P4NB7-YQ6XK-Y8MMM-YWV2J
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 10, 2024 00:16
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S