Skip to content

Instantly share code, notes, and snippets.

@april
april / git-log-json.sh
Last active December 20, 2023 13:11
pure shell function for git log as JSON
# attempting to be the most robust solution for outputting git log as JSON,
# using only `git` and the standard shell functions, without requiring
# additional software.
# - uses traditional JSON camelCase
# - includes every major field that git log can output, including the body
# - proper sections for author, committer, and signature
# - multiple date formats (one for reading, ISO for parsing)
# - should properly handle (most? all?) body values, even those that contain
# quotation marks and escaped characters
@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 25, 2024 03:58 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@kurtschlatzer
kurtschlatzer / patch-edid.md
Last active October 13, 2023 06:46 — forked from ejdyksen/patch-edid.md
Fix EDID problems on external monitors in Mac OS.
/* VT100 terminal reset (<ESC>c) */
console.log('\033c');
/* numbers comparations */
> '2' == 2
true
> '2' === 2
@nmz787
nmz787 / each_cell_on_its_own_line
Last active August 20, 2023 09:38
git-xlsx-textconv-python
import xlrd
import sys
if __name__ == '__main__':
if len(sys.argv) != 2:
print "Usage: git-xlsx-textconv file.xslx"
excelFileName = sys.argv[1]
xlFile = xlrd.open_workbook(excelFileName)
@niksumeiko
niksumeiko / git.migrate
Last active April 25, 2024 04:04
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@nolanlawson
nolanlawson / completion-for-gradle.md
Last active April 5, 2024 07:43
Gradle tab completion for Bash. Works on both Mac and Linux.

Gradle tab completion script for Bash

A tab completion script that works for Bash. Relies on the BSD md5 command on Mac and md5sum on Linux, so as long as you have one of those two commands, this should work.

Usage

$ gradle [TAB]
@sgr
sgr / workaround_the_iconservices_bug_mavericks.sh
Last active July 25, 2020 11:01
When "com.apple.IconServicesAgent" exhausts CPU resources on Mac OSX mavericks (10.9), you can try following workaround.
#!/bin/sh
mkdir ${TMPDIR}/com.apple.IconServices
@4ndrej
4ndrej / SSLPoke.java
Last active January 3, 2024 09:50
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {