This proposal is not longer active. Context: https://twitter.com/siddharthkp/status/909818777314902016
| ######################## | |
| # UUID for SQLite hack # | |
| ######################## | |
| from sqlalchemy.types import TypeDecorator, CHAR | |
| from sqlalchemy.dialects.postgresql import UUID | |
| import uuid | |
| class GUID(TypeDecorator): |
| #!/usr/bin/env python | |
| import sys | |
| import requests | |
| import firebase_admin | |
| from firebase_admin import credentials | |
| from firebase_admin import storage | |
| image_url = sys.argv[1] #we pass the url as an argument | |
| cred = credentials.Certificate('path/to/certificate.json') |
| """ | |
| Middleware to log all requests and responses. | |
| Uses a logger configured by the name of django.request | |
| to log all requests and responses according to configuration | |
| specified for django.request. | |
| """ | |
| # import json | |
| import logging | |
| from django.utils.deprecation import MiddlewareMixin |
This proposal is not longer active. Context: https://twitter.com/siddharthkp/status/909818777314902016
| package main | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "fmt" | |
| "crypto/rand" | |
| "io" | |
| "encoding/base64" | |
| "encoding/hex" |
| URL="http://stackoverflow.com/" | |
| # store the whole response with the status at the and | |
| HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL) | |
| # extract the body | |
| HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g') | |
| # extract the status | |
| HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
| #!/bin/sh | |
| # Called by "git push" after it has checked the remote status, | |
| # but before anything has been pushed. | |
| # | |
| # If this script exits with a non-zero status nothing will be pushed. | |
| # | |
| # Steps to install, from the root directory of your repo... | |
| # 1. Copy the file into your repo at `.git/hooks/pre-push` | |
| # 2. Set executable permissions, run `chmod +x .git/hooks/pre-push` |