This file contains hidden or 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
import datetime | |
class Employee: | |
def __init__(self, first_name: str , last_name: str, birth: datetime, hourly_rate: int, labor_hours: int): | |
self.first_name = first_name | |
self.last_name = last_name | |
self.birth = birth | |
self._hourly_rate = hourly_rate | |
self._labor_hours = labor_hours |
This file contains hidden or 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
import sys | |
import arrow | |
import shelve | |
import os.path | |
from datetime import datetime, timedelta | |
# Name of the file used by PersistentScheduler to store the last run times of periodic tasks. | |
FN_CELERYBEAT = 'celerybeat-schedule' |
This file contains hidden or 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
# export GOOGLE_APPLICATION_CREDENTIALS='credential file in JSON' | |
import arrow | |
from google.cloud import monitoring_v3 | |
from google.cloud.monitoring_v3 import enums | |
from google.cloud.monitoring_v3.types import TimeInterval, Aggregation | |
from google.api_core import exceptions | |
client = monitoring_v3.MetricServiceClient() |
This file contains hidden or 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
from __future__ import print_function | |
""" | |
Utilities for 256 color support in terminals. | |
Adapted from: | |
http://stackoverflow.com/questions/1403353/256-color-terminal-library-for-ruby | |
The color palette is indexed as follows: | |
0-15: System colors |
This file contains hidden or 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
wget -m -p -E -k -K -np http://site/path/ |
This file contains hidden or 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
env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" CFLAGS="-I/usr/local/opt/openssl/include" pip install cryptography |
This file contains hidden or 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
curl -i -H "Origin: http://[web app domain]" -H "Access-Control-Request-Method: GET" -X OPTIONS [target web resource] |
This file contains hidden or 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
The standalone version of hieararchyviewer is deprecated. | |
Please use Android Device Monitor (tools/monitor) instead. | |
08:57:39 E/ViewServerDevice: Unable to debug device: samsung-sm_n9208-05157df5db5a2417 | |
08:57:39 E/hierarchyviewer: Missing forwarded port for 05157df5db5a2417 | |
08:57:39 E/hierarchyviewer: Unable to get the focused window from device 05157df5db5a2417 | |
For anyone working with Android 4.1 or later: | |
you can get Hierarchy Viewer working by setting the environment variable ANDROID_HVPROTO to ddm. | |
Mac OSX/Android Studio users, remember to start hierarchy viewer from command line so it will pick up the environment variable. |
This file contains hidden or 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
'use strict'; | |
/** | |
* Follow these steps to configure the webhook in Slack: | |
* | |
* 1. Navigate to https://<your-team-domain>.slack.com/services/new | |
* | |
* 2. Search for and select "Incoming WebHooks". | |
* | |
* 3. Choose the default channel where messages will be sent and click "Add Incoming WebHooks Integration". |
This file contains hidden or 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
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.3.0 |