Skip to content

Instantly share code, notes, and snippets.

View jpcofr's full-sized avatar

Juan Pablo Contreras Franco jpcofr

  • Gothenburg, Sweden
View GitHub Profile
@jpcofr
jpcofr / temp.py
Last active March 22, 2024 13:27
temporal
#!/bin/bash
for i in {1..2300}
do
touch "file_${i}.txt"
done
bash -c 'for dir in */; do ku bectl cp "${dir}" "default/my-pod:/data/${dir}"; done'
@coffeenotfound
coffeenotfound / h.code-snippets
Created September 21, 2018 11:31
Visual Studio Code C Include Guard Snippet
{
"Add include guard": {
"prefix": "guard",
"description": "Adds an ifndef include guard to a C header",
"body": [
"#ifndef __${TM_FILENAME/^([^\\.]*)\\..*$/${1:/upcase}/}_${TM_FILENAME/^.*\\.([^\\.]*)$/${1:/upcase}/}__",
"#define __${TM_FILENAME/^([^\\.]*)\\..*$/${1:/upcase}/}_${TM_FILENAME/^.*\\.([^\\.]*)$/${1:/upcase}/}__",
"",
"$0",
"",
@androidfred
androidfred / advanced_anki_deck_editing.md
Last active February 15, 2023 18:47
Advanced Anki deck editing made simple (ish)

Advanced Anki deck editing made simple (ish)

Anki is a great open source flashcard app that can be used to learn anything.

This Gist is a full end to end example of how to:

  • export Anki decks from Anki
  • import Anki decks into MySQL
  • edit Anki decks using MySQL
  • export Anki decks from MySQL
@gravitylow
gravitylow / codesign_gdb.md
Last active April 16, 2024 02:18 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@jpcofr
jpcofr / d3_svg_server_rendering.js
Created August 2, 2017 14:36
Renders an svg circle at server side
var fs = require('fs');
var d3 = require('d3')
require('jsdom-global')()
var body = document.querySelector('body')
d3.select(body)
.append('svg:svg')
.attr('xmlns', 'http://www.w3.org/2000/svg')
.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink')
@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active April 13, 2024 22:39
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@w0rd-driven
w0rd-driven / passwords.txt
Created November 18, 2016 20:19
BFG Repo-Cleaner --replace-text example
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default)
PASSWORD2==>examplePass # replace with 'examplePass' instead
PASSWORD3==> # replace with the empty string
regex:password=\w+==>password= # Replace, using a regex
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines
@patriciogonzalezvivo
patriciogonzalezvivo / PythonSetup.md
Created October 7, 2014 23:17
How to install Python correctly on Mac OSX

Install Homebrew

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Add PATH to ~/.bash_profile and ~/.zshrc

export PATH=/usr/local/bin:$PATH
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@caged
caged / d3-server.js
Last active October 17, 2023 04:05
Directly render and serve d3 visualizations from a nodejs server.
// Start `node d3-server.js`
// Then visit http://localhost:1337/
//
var d3 = require('d3'),
http = require('http')
http.createServer(function (req, res) {
// Chrome automatically sends a requests for favicons
// Looks like https://code.google.com/p/chromium/issues/detail?id=39402 isn't
// fixed or this is a regression.