Skip to content

Instantly share code, notes, and snippets.

@tomcon
tomcon / git-find-me-the-fucking-deleted-file.sh
Created April 1, 2024 10:13 — forked from joakin/git-find-me-the-fucking-deleted-file.sh
finding a deleted file in a git repository
# If you don't remember the exact path/name, search the log for deleted files
git log --diff-filter=D --summary | grep delete
# Find the file you want to get from the ouput, and use the path
# Find the commits that involved that path
git log --all -- some/path/to/deleted.file
# Bring the file back to life to the current repo (sha commit of parent of commit that deleted)
git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file
@tomcon
tomcon / list-of-curl-options.txt
Created March 13, 2022 08:58 — forked from eneko/list-of-curl-options.txt
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.resize-drag{
z-index:200;
position:absolute;
border: 2px dashed #ccc;
}
.out-container-content ,.container-content{
@tomcon
tomcon / git-tag-delete-local-and-remote.sh
Created December 6, 2019 15:43 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@tomcon
tomcon / README.md
Created June 30, 2019 20:57 — forked from magnetikonline/README.md
NSSM - the Non-Sucking Service Manager cheatsheet.
@tomcon
tomcon / nginxproxy.md
Created May 25, 2019 18:57 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@tomcon
tomcon / letsencrypt_2019.md
Created May 24, 2019 10:02 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@tomcon
tomcon / noscript-tracking.go
Created May 11, 2019 19:17 — forked from wybiral/noscript-tracking.go
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@tomcon
tomcon / Component.html
Created May 9, 2019 20:10 — forked from nolanlawson/Component.html
SvelteJS click delegation example
<button delegate-key="foo">Click me</button>
<script>
import { registerClickDelegate, unregisterClickDelegate } from './delegate'
export default {
oncreate() {
registerClickDelegate('foo', () => {
console.log('clicked!')
})
},
ondestroy() {
@tomcon
tomcon / a-simple-socket-io-test.md
Created May 4, 2019 20:04 — forked from janusnic/a-simple-socket-io-test.md
A simple Socket.io test with client and server (Node.js) parts.