Skip to content

Instantly share code, notes, and snippets.

@JavadocMD
JavadocMD / chrome_open_bookmark.py
Created November 12, 2016 00:18
A script to open Chrome bookmarks or entire folders of bookmarks by name. (Windows)
#!/usr/bin/env python
import os, subprocess, json
# Get all bookmarks matching the given name(s)
def get_bookmarks(profile_dir, names):
with open(os.path.join(profile_dir, 'Bookmarks')) as f:
j = json.load(f)
results = []
# There are two root-level bookmark folders: one for the bookmark bar and one for all others.
@eugene-babichenko
eugene-babichenko / CMakeLists.txt
Last active July 1, 2023 18:01
CMakeLists.txt and toolchain file for building STM32 HAL-based projects generated with STM32CubeMX with arm-none-eabi-gcc. STM32CubeMX settings. Toolchain: SW4STM32. ☑ Generate under root.
set(PRJ_NAME CLion_STM_LED)
set(MCU_FAMILY STM32F1xx)
set(MCU_LINE STM32F103xB)
set(MCU_LINKER_SCRIPT STM32F103RBTx_FLASH.ld)
cmake_minimum_required(VERSION 3.6)
project(${PRJ_NAME} C ASM)
add_definitions(-D${MCU_LINE})
@r-lyeh-archived
r-lyeh-archived / curve.hpp
Last active October 26, 2023 06:33
wip imgui curve
// [src] https://github.com/ocornut/imgui/issues/123
// [src] https://github.com/ocornut/imgui/issues/55
// v1.22 - flip button; cosmetic fixes
// v1.21 - oops :)
// v1.20 - add iq's interpolation code
// v1.10 - easing and colors
// v1.00 - jari komppa's original
#pragma once
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@barrysteyn
barrysteyn / svn-to-git.md
Last active December 26, 2022 22:32
Migrate From SVN To GIT
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@kylemanna
kylemanna / connmanctl.md
Last active June 27, 2023 23:12
Connmanctl Cheat Sheet
@jvranish
jvranish / stack_traces.c
Last active April 25, 2024 15:51
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@royvandam
royvandam / CMakeLists.txt
Created July 2, 2012 14:11
Adds an uninstall target to the CMAKE generated Makefile.
##
# Add uninstall target
# Requirements: Copy the uninstall.cmake file to the appropriate CMAKE_MODULE_PATH.
#
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_MODULE_PATH}/uninstall.cmake"
)