Skip to content

Instantly share code, notes, and snippets.

@noelbundick
noelbundick / LICENSE
Last active April 11, 2024 16:12
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@felipou
felipou / decrypt_dbeaver.py
Last active March 18, 2024 18:46
DBeaver password decryption script - for newer versions of DBeaver
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection
# requires pycryptodome lib (pip install pycryptodome)
import sys
import base64
import os
import json
from Crypto.Cipher import AES
@bokmann
bokmann / JRuby Awesome Performance
Last active August 31, 2023 07:32
brief summary of massive performance improvements with JRuby
# Thee will be more information here when I share the entire problem space I'm working on, but
# in short, this is preview material for my second talk in a series called "What Computer Scientists Know".
# The first talk is on recursion, and goes through several examples., leading up to a problem based
# on a simple puzzle that initial estimates based on performance of a previous puzzle would take years
# to solve on modern computers with the techniques shown in Ruby. That sets the stage for improving the
# performance of that problem with threading, concurrency, and related tuning.
#
# The second talk is on threading and concurrency, touching on algorithmic performance as well.
# Using some knowledge of the problem (board symmetry, illegal moves, etc), we reduce the problem space
# to about .5% of what we initially thought it was. Still, the initial single threaded solution took more
@tototoshi
tototoshi / rownum.sql
Created December 26, 2012 01:14
Grouped LIMIT in PostgreSQL: show the first N rows for each group
-- http://stackoverflow.com/questions/1124603/grouped-limit-in-postgresql-show-the-first-n-rows-for-each-group
-- http://www.postgresql.jp/document/9.2/html/tutorial-window.html
CREATE TABLE empsalary (
depname varchar(10) not null
, empno integer not null
, salary integer not null
);
INSERT INTO empsalary (depname, empno, salary) VALUES ('develop', 11, 5200);

How do I do this thing?

I'm not aware of how to use Google, how do I do this basic thing in Language X?

tagged coding, question

edited by Grammar Nazi (2.5M), asked by 1337z0r (2)

Answer 1 (12)

@leonklingele
leonklingele / 0001-apple-keychain-integration-other-changes.patch
Last active May 15, 2022 14:09
openssh-{7.7,7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7,8.8,8.9,9.0}p1 patches for storing SSH passphrases in the OS X keychain. https://github.com/leonklingele/homebrew-dupes
From 056f784b90d67dcd76aa87aa092d1ecd281b1480 Mon Sep 17 00:00:00 2001
From: Leon Klingele <git@leonklingele.de>
Date: Thu, 24 Feb 2022 21:50:11 +0100
Subject: [PATCH 1/2] apple-keychain-integration-other-changes
---
Makefile.in | 16 +-
audit-bsm.c | 7 +-
auth.c | 2 +-
authfd.c | 25 ++
@greymd
greymd / Main.java
Created February 10, 2017 05:14
Prime numbers with Java8 Stream API
import java.util.stream.IntStream;
class Main {
public static void main(String args[]) {
IntStream.rangeClosed(2, 100)
.filter(i -> IntStream.rangeClosed(2, (int)Math.sqrt(i))
.allMatch(j -> i%j != 0))
.forEach(n -> {
System.out.println(n);
});
@therealmarv
therealmarv / checkopenssl.md
Last active October 12, 2021 19:14
Check OpenSSL version from Python

Open python

python

and type

>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1g 7 Apr 2014'
@dannyid
dannyid / seek.js
Last active March 6, 2021 22:47
Netflix Seek
// The player
var player = netflix.cadmium.objects.videoPlayer();
// Metadata about current episode -- ID and url to get frame at a specific time
var episodeId = netflix.cadmium.metadata.getActiveVideo().episodeId;
var imgRoot = netflix.cadmium.metadata.getActiveVideo().progressImageRoot;
// Generates URL of preview image for given timestamp
function getFrame(timestamp) {
var t = Math.floor(timestamp/10000).toString(10);
@maxinspace
maxinspace / readme.txt
Created October 20, 2015 11:03
Google Authenticator from Terminal
This instruction will allow you to get keys from Google Authenticator via terminal.
1) Download oathtool
brew install oathtool
http://www.nongnu.org/oath-toolkit/oathtool.1.html
2) Get your 2-Factor authentication secret key.
For example, instead of capturing barcode, ask Google 2-factor auth to enter code manually.
And google 2-factor auth will provide you your secret key.