Skip to content

Instantly share code, notes, and snippets.

Gregory Pacheco Gpzim98

View GitHub Profile
View cataki.error
In module 'UIKit' imported from /Users/gregorypacheco/Library/Developer/Xcode/DerivedData/Cataki-dxdbfptxbcfahtclbubecydrrlpk/Build/Intermediates.noindex/ArchiveIntermediates/Cataki/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/include/Cordova/CDVPlugin.h:21:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:459
:63: note: property 'statusBarHidden' is declared deprecated here
@property(readwrite, nonatomic,getter=isStatusBarHidden) BOOL statusBarHidden NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController prefersStatusBarHidden]") __TVOS_PROHIBITED;
^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:459:63: note: 'setStatusBarHidden:' has been explicitly marked deprecated here
/Users/gregorypach
View IAM
Roles
- Or you might want to allow a mobile app to use AWS resources, but not want to embed AWS keys within the
app (where they can be difficult to rotate and where users can potentially extract them).
Sometimes you want to give AWS access to users who already have identities defined outside of AWS, such as in your corporate
directory. Or, you might want to grant access to your account to third parties so that they can perform an audit on your resources.
View EC2
Fixed Performance Instances (e.g. M3, C3, and R3)
Burstable Performance Instances
- T2
- Accrue CPU Credits when they are idle
- It stores them in its CPU Credit balance for up to 24 hours.
- If and when your t2.small needs to burst to more than 20% of a core, it draws from its
CPU Credit balance to handle this surge seamlessly
Cluster
View RK Python Seminar
- obj, created = AppSettings.objects.get_or_create(name='DEFAULT_LANG')
- Uso do dir(obj)
- Dont use exception as a flow control
- every exception should do log
- Database tips from brazilian guy article
View Bash
# Mysql DUMP
#!/bin/bash
user="user"
password="pass"
host="localhost:port"
db_name="db_name"
backup_path="/home/ubuntu/path/"
date=$(date +"%d-%b-%Y")
# Set default file permissions
View RK seminar
my_variable not myVariable or even MyVariable
MyClass
View Javascript
# 1 - Promisses
p.then(onFulfilled[, onRejected]);
p.then(function(value) {
// fulfillment
}, function(reason) {
// rejection
});
# 2 - Find an object in a array
View Linux
# 1 - Find file terminal
find ~/ -type f -name "generate_interval.py"
# 2 - Checking HD size
df -H
# 3 - Tailing a log in realtime
tailor -f file.log
# 4 - If else param script bash
@Gpzim98
Gpzim98 / DRF
Last active Nov 17, 2017
Django Rest Framework views best practices
View DRF
# 1 - Ideal DRF View
from rest_framework import status
from rest_framework.decorators import detail_route
from rest_framework.response import Response
import logging
def do_log(e):
logger = logging.getLogger('django')
time = datetime.datetime.now()
You can’t perform that action at this time.