This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://docs.djangoproject.com/en/dev/topics/security/#ssl-https | |
""" | |
if '1' in str(os.getenv('SECURE_SSL')): | |
SECURE_SSL_REDIRECT = True | |
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') | |
"""".env file: | |
SECURE_SSL=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
s = 'word1 :blush: word2' | |
print(re.sub(':[^:]+:', '', s).strip()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>URL</key> | |
<string>https://discordapp.com/developers/docs/resources/webhook#execute-webhook</string> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
{ set +x; } 2>/dev/null | |
set ~/Applications/name.app | |
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
VERSIONER_PERL_PREFER_32_BIT=1 perl -MMac::InternetConfig -le 'print +(GetICHelper "http")[1]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NODE_PATH:=~/node_modules | |
sass: | |
node-sass --include-path $(NODE_PATH) ./static/src/index.scss ./static/src/index.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS t( | |
id serial PRIMARY KEY, | |
value text | |
); | |
INSERT INTO t(id,value) VALUES (1,'value1'), (2,'value2'); | |
CREATE TABLE t_with_data AS TABLE t; | |
CREATE TABLE t_without_data AS TABLE t WITH NO DATA; | |
select COUNT(*) from t_without_data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | new_value1 | |
---|---|---|
2 | new_value2 |
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,val"ue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION basename(path text) RETURNS text AS $$ | |
SELECT reverse((regexp_split_to_array(reverse($1), '/'))[1]) | |
$$ | |
LANGUAGE SQL IMMUTABLE; | |
SELECT basename('/Users/username/git/owner/repo'); | |
OlderNewer