Skip to content

Instantly share code, notes, and snippets.

@lx4r
lx4r / nodejs.errno.h
Created June 22, 2020 12:33 — forked from pbojinov/nodejs.errno.h
node.js errno descriptions. Useful for debugging.
/* Pulled from https://github.com/joyent/node/blob/master/deps/uv/include/uv.h */
/* Expand this list if necessary. */
#define UV_ERRNO_MAP(XX) \
XX(E2BIG, "argument list too long") \
XX(EACCES, "permission denied") \
XX(EADDRINUSE, "address already in use") \
XX(EADDRNOTAVAIL, "address not available") \
XX(EAFNOSUPPORT, "address family not supported") \
XX(EAGAIN, "resource temporarily unavailable") \
XX(EAI_ADDRFAMILY, "address family not supported") \
@lx4r
lx4r / MakePowerShellRememberSSHPassphrase.md
Created May 1, 2020 09:10 — forked from danieldogeanu/MakePowerShellRememberSSHPassphrase.md
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell: git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe;

  2. Configure SSH to automatically add the keys to the agent on startup by editing the config file found at C:\Users\%YOUR_USERNAME%\.ssh\config, and add the following lines:

@lx4r
lx4r / .eslintrc.js
Created April 22, 2020 08:52 — forked from developit/.eslintrc.js
Preact CLI 3 + TypeScript starter
module.exports = {
env: {
browser: true
},
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended'
],
@lx4r
lx4r / banana.js
Last active December 6, 2019 19:52
Banana
const banana = ('b' + 'a' + + 'a' + 'a').toLowerCase();
console.log(banana); // banana
@lx4r
lx4r / keybase.md
Created March 29, 2014 13:15
keybase.md

Keybase proof

I hereby claim:

  • I am lx4r on github.
  • I am lx4r (https://keybase.io/lx4r) on keybase.
  • I have a public key whose fingerprint is 7873 A4F2 236F 7120 0DF1 9F81 A2C3 589F FE23 D6A9

To claim this, I am signing this object:

@lx4r
lx4r / next_element.js
Last active December 24, 2015 21:59
This code snippet echos the next element from a JavaScript array to a html element (e.g. a <div>) starting with a random one. The array can contain text as well as html markup.
/*
1.) Just replace the elements of the array with the ones you want to show.
2.) Replace .next_element with something to switch to the next element (e.g. a button).
3.) Replace .output with the element you want to fill with the elements of the array.
*/
$(document).ready(function() {
var items = Array('1', '2', '3', '4', '<a href="http://example.com">5</a>');
var range = items.length;
var position = Math.floor(Math.random()*range);
$('.output').html(items[position]);
@lx4r
lx4r / Vowel mutation fix.php
Created June 17, 2012 12:42
Tiny script for converting text with some special character problems to normal text
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<?php
$search = array('ü','ö','„',"“",'ä','ß','€');
$replace = array('ü','ö','"','"','ä','ß','€');
if (isset ($_POST["input"]) && isset($_POST["convert"])){
$fail_text = $_POST["input"];
$fixed_text = str_replace($search, $replace, $fail_text);
}
?>
<html>