Skip to content

Instantly share code, notes, and snippets.

View OldskoolOrion's full-sized avatar

Oldskool Orion OldskoolOrion

View GitHub Profile
@XVilka
XVilka / sync.py
Created April 9, 2020 10:17
Dotfiles Syncronization Script
#!/usr/bin/env python3
# pylint: disable=missing-docstring
# pylint: disable=invalid-name
# pylint: disable=wrong-import-position
# pylint: disable=import-outside-toplevel
# pylint: disable=logging-format-interpolation
"""Dotfiles Syncronization Script
This script allows to syncronize your dotfiles among different computers with
@jesperorb
jesperorb / cors.md
Last active February 21, 2024 14:17
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin
@alinefr
alinefr / check_cloudflare_lastpass.py
Last active March 1, 2017 05:21 — forked from anp/check_cloudflare_lastpass.py
Check a LastPass CSV export for potential CloudFlare vulnerabilities
"""
This is the product of me spending a few minutes trying to
assess how much of my LastPass vault is potentially vulnerable
to the recent CloudFlare issue.
It's hacky, and probably broken in some way, but it's a start.
Gist comments with improvements very welcome.
"""
@zoryana94
zoryana94 / introrx.md
Created February 26, 2017 01:41 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@OldskoolOrion
OldskoolOrion / normalize_to_utf8_chars.php
Last active March 11, 2017 12:32
PHP function to 'normalize' data, mangled before by some process (e.g. treating UTF-8 as Windows1252).
<?
/*
URL : https://github.com/OldskoolOrion/normalize_to_utf8_chars
Function usable when normalizing input data, that has been mangled before, by :
1) Encoding Problem : Treating UTF-8 Bytes as Windows-1252 or ISO-8859-1
2) Encoding Problem : Incorrect Double Mis-Conversion
@forivall
forivall / LogitechGkeysToF13to18.lua
Created July 21, 2015 06:28
Lua script for logitech gaming software to emulate F13-18 with G1-6
keymap = {
[1]="f13",
[2]="f14",
[3]="f15",
[4]="f16",
[5]="f17",
[6]="f18",
}
function OnEvent(event, gkey, family)
@Hades32
Hades32 / run.sh
Last active August 25, 2017 17:58
Start a docker container with environment variables for external port and IP
#!/bin/bash
#Start a docker container with environment variables for external port and IP
if [ -z $1 ]
then
echo pass in starting port
exit 1
fi
START_PORT=$1
@oshybystyi
oshybystyi / git-auto-status.plugin.zsh
Created June 10, 2015 10:28
OhMyZsh plugin to display git status after a bunch of predefined git commands
#
# Run git status after specified set of command
#
# @author Oleksandr Shybystyi oleksandr.shybystyi@gmail.com
#
# default list of git commands `git status` is running after
gitPreAutoStatusCommands=(
'add'
'rm'
@staltz
staltz / introrx.md
Last active July 27, 2024 04:59
The introduction to Reactive Programming you've been missing