Skip to content

Instantly share code, notes, and snippets.

@smilemakc
smilemakc / gist:d3ce7a4fd3b2a8d91b92ffc68c054c2d
Created February 21, 2024 21:15 — forked from lideo/gist:82fb863749f4efe1deb9ca146b1093e8
Exclude .DS_Store file from tar.gz
tar -zcv --exclude='.DS_Store' -f file.tar.gz folder/
@smilemakc
smilemakc / example.cs
Created September 28, 2017 13:04 — forked from brandonmwest/example.cs
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));
@smilemakc
smilemakc / nginx-uwsgi-python3
Created December 22, 2016 22:44 — forked from simoncoulton/nginx-uwsgi-python3
Setting up Nginx, uWSGI & Python3
======================================
Setting up Nginx, uWSGI and Python3
======================================
First off, I'm traditionally a PHP developer, but am looking at moving across to Python. I really struggled to find decent documentation on how to get a server up and running for deploying Python web applications from the point of view of someone coming from PHP. The main problems I came across with documentation were:
1) Only showed you how to run the server for a single web application.
2) Only showed you how to configure the app, not the server it was running on.
My preferred workflow for development is by setting up a new VM in VMware Fusion and then forwarding through all requests to that VM via /etc/hosts. This might not be the optimal way to get things up and running, but it works for me.
@smilemakc
smilemakc / auto_add_migrations.xml
Created December 21, 2016 00:46 — forked from fhanspach/auto_add_migrations.xml
A custom File Watcher for PyCharm to automatically add migrations in django projects
<?xml version="1.0" encoding="UTF-8"?>
<TaskOptions>
<TaskOptions>
<option name="arguments" value="add $FileDir$/$FileName$" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" value="auto add migrations" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="py" />
<option name="immediateSync" value="true" />
<option name="name" value="migrations" />