Skip to content

Instantly share code, notes, and snippets.

View kvpb's full-sized avatar
🍀

Karl kvpb

🍀
  • Paris, France
  • 22:46 (UTC +02:00)
View GitHub Profile
@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
@rasschaert
rasschaert / arch_bootstrap.bash
Last active July 27, 2022 12:43
Shell script that performs the installation of Arch Linux the way I like it.
#!/bin/bash
bootstrapper_dialog() {
DIALOG_RESULT=$(dialog --clear --stdout --backtitle "Arch bootstrapper" --no-shadow "$@" 2>/dev/null)
}
#################
#### Welcome ####
#################
bootstrapper_dialog --title "Welcome" --msgbox "Welcome to Kenny's Arch Linux bootstrapper.\n" 6 60
@jacobsalmela
jacobsalmela / app-store-pkgs.sh
Created December 30, 2014 03:15
Save App Store downloads as .pkgs
#!/bin/bash
appStoreFolder=$(sudo find /private/var/folders -type f -name "*.pkg")
i=0
for package in $appStoreFolder
do
sudo ln $package ~/Downloads/_MAS_$i.pkg
i=$(($i+1))
done
@josephspurrier
josephspurrier / values_pointers.go
Last active May 28, 2024 07:30
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@jerrykrinock
jerrykrinock / JerryLib.scptd
Last active March 21, 2023 11:52
My personal utility library of AppleScript handlers, and some one-liners
-- To load this library, see section titled "-- Using a handler in a .scpt library" at the top of One_Liners.scpt.
on testJerryLib()
return 0
end testJerryLib
(* The bad thing about this handler is that it always asks the user for admin credentials whether or not they are actually needed to answer the question on the given path.
Obviously, you can remove the 'with adminstrator privileges'. Unfortunately, this will cause the method to return 'false' if an existing path cannot be probed because of bad permissions. I can't see any way to differentiate between inadequate permissions and nonexisting file because they both set errNumber = 54.
The -e checks for directories or files. To require that the given path be a directory, use -d. For file, use -f. For more variations, see:
http://www.cyberciti.biz/tips/find-out-if-file-exists-with-conditional-expressions.html *)
@RadicalZephyr
RadicalZephyr / img-separator.sh
Last active June 25, 2023 21:04
Copy image files from a folder and rename based on type.
#!/usr/bin/env bash
set -e
if [ $# -lt 1 ]
then
echo "You must enter the name of a folder."
exit 1
fi
@Zenexer
Zenexer / Mac Keyboard Symbols.md
Last active May 4, 2024 02:14
List of Mac/Apple keyboard symbols
@alexkuhl
alexkuhl / cs_cheat_sheet.txt
Created October 17, 2015 16:24
Computer Science "Cheat Sheet"
This "cheat sheet" is designed to be a super-high level view of common and/or important computer science concepts. Good for test reviews, preparing for job interviews, brushing up on the basics, becoming a better person, or light reading for putting your significant other to sleep. I will continue to update this so if you have any suggestions or corrections please send a pull request or contact me. Licensed under http://creativecommons.org/licenses/by-sa/3.0/.
Algorithms
+ Limiting behavior (all the second sections are as limit(n)->infinity)
* Big O - f is bounded by g :: f(n) <= g(n)*c (for some constant c) :: an upper bound, can be much higher than actual performance because this is not a tight bound, for example a log(n) algorithm technically is O(n!) but is obviously way better than something that actually gets n! performance
* Small or Little o - f dominated by g :: f(n) < g(n)*c; f(n)/g(n) = 0 :: g gets much larger
* Big Omega - f is bounded below by g :: |f(n)| >= g(n)*c :: a lower bound, bu
@hut8
hut8 / CSS CRT screen effect.markdown
Created November 9, 2015 06:47
CSS CRT screen effect
@djaiss
djaiss / gist:85a0ada83e6bca68e41e
Last active January 1, 2024 22:44
Block Twitter/Facebook in your /etc/hosts
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net