Skip to content

Instantly share code, notes, and snippets.

Avatar
⚛️

Thiago Krempser tkrempser

⚛️
View GitHub Profile
@tkrempser
tkrempser / git_update.sh
Created Aug 29, 2021
Update Git to the latest version on Ubuntu
View git_update.sh
#!/bin/bash
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update && sudo apt-get install git -y
@tkrempser
tkrempser / macOS.gitignore
Created May 28, 2019
macOS .gitignore template.
View macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
@tkrempser
tkrempser / url_slug.js
Created Nov 14, 2017 — forked from sgmurphy/url_slug.js
URL Slugs in Javascript (with UTF-8 and Transliteration Support)
View url_slug.js
/**
* Create a web friendly URL slug from a string.
*
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
@tkrempser
tkrempser / allow_cors_get.py
Last active Oct 19, 2017
Python function to allow Cross-origin resource sharing from any origin using GET request method.
View allow_cors_get.py
def allow_cors_get(http_response):
http_response['Access-Control-Allow-Origin'] = "*"
http_response['Access-Control-Expose-Headers'] = "Content-Type"
http_response['Access-Control-Allow-Methods'] = "GET"
http_response['Access-Control-Allow-Headers'] = "Content-Type"
http_response['Access-Control-Allow-Credentials'] = "false"
return http_response