Skip to content

Instantly share code, notes, and snippets.

@yatima1460
yatima1460 / weekend.ics
Last active February 22, 2021 11:53
iCal Calendar for weekend
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20210101
DTEND:20210101
RRULE:FREQ=WEEKLY;BYDAY=SA;BYSETPOS=-1
SUMMARY:Weekend Start
END:VEVENT
BEGIN:VEVENT
DTSTART:20210101
DTEND:20210101
@jayvdb
jayvdb / RefreshEnv.sh
Last active February 4, 2022 07:01
chocolatey RefreshEnv for bash
function refreshenv
{
powershell -NonInteractive - <<\EOF
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Update-SessionEnvironment
# Round brackets in variable names cause problems with bash
Get-ChildItem env:* | %{
if (!($_.Name.Contains('('))) {
@alexxxdev
alexxxdev / gist:1dd024cadea091ca64154f9616d5739a
Created August 16, 2018 15:08
remote: fatal: pack exceeds maximum allowed size
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else
@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
@luluco250
luluco250 / search_cppreference.js
Last active December 8, 2017 04:47
Bookmarklet to search cppreference via a browser bookmark, just copy and paste it onto a new bookmark.
javascript: (function() {
const search_text = prompt("Search cppreference");
if (search_text !== null)
window.location.href =
"http://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search="
+ search_text;
}());
diff --git a/gtk/gtkfilechooserprivate.h b/gtk/gtkfilechooserprivate.h
index a0a622c111..2af859433d 100644
--- a/gtk/gtkfilechooserprivate.h
+++ b/gtk/gtkfilechooserprivate.h
@@ -32,10 +32,14 @@
#include "gtktreestore.h"
#include "gtktreeview.h"
#include "gtkbox.h"
+#include "gtkiconview.h"
+#include "gtkscale.h"
@Dudemanguy
Dudemanguy / gtk2-filechooser-icon-view.patch
Last active December 21, 2020 04:27 — forked from ahodesuka/gtk2-filechooser-icon-view.patch
Adds an icon view to the gtk2 filechooser upload dialog. Generated from https://github.com/Dudemanguy911/gtk/tree/gtk2-filechooser-icon-view
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index c11354248e..a994aa9c6f 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -80,6 +80,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <locale.h>
+#include <math.h>
@jashkenas
jashkenas / semantic-pedantic.md
Last active November 29, 2023 14:49
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 3, 2024 12:32
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,