Skip to content

Instantly share code, notes, and snippets.

import React, { useState } from 'react';
import { withStyles } from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogTitle from '@material-ui/core/DialogTitle';
import axios from 'axios';
@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.
@linw1995
linw1995 / tasks.json
Created August 4, 2017 05:45
VSCode Task.json for Python Traceback.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [{
"taskName": "Run Python",
"group": {
"kind": "build",
"isDefault": true
},
@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"
)
@jvranish
jvranish / c_option_type.c
Last active May 2, 2022 19:17
Simple option type in C
//usr/bin/make -s "${0%.*}" CFLAGS="-O2 -Wall -Werror" && ./"${0%.*}" "$@"; s=$?; rm ./"${0%.*}"; exit $s
#include <stdio.h>
#include <stdbool.h>
enum option_tag { OPTION_SOME, OPTION_NONE };
#define option_type(T) { enum option_tag tag; T some; }
#define SOME(S) { .tag = OPTION_SOME, .some = S }
#define NONE() { .tag = OPTION_NONE }
@julbouln
julbouln / c_refactoring_tool.rb
Created April 7, 2021 14:52
convert C globals to structures using clang ast json dump
require 'set'
require 'json'
require 'tree'
require 'fileutils'
# convert C globals to structures using clang ast json dump
# algorithm description
# - get AST with clang
# - convert AST into ruby tree
@barrysteyn
barrysteyn / svn-to-git.md
Last active December 26, 2022 22:32
Migrate From SVN To GIT
@kylemanna
kylemanna / connmanctl.md
Last active June 27, 2023 23:12
Connmanctl Cheat Sheet
@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