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
# 1. Create the docker group. | |
$ sudo groupadd docker | |
# 2. Add your user to the docker group. | |
$ sudo usermod -aG docker $USER | |
# 3. Log out and log back in so that your group membership is re-evaluated. | |
# 4. Verify that you can run docker commands without sudo. | |
$ docker run hello-world |
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
list_schedule = [] | |
for user in sc.candidates.all(): | |
data = dict( | |
email=user.email, | |
cpf=cpf, | |
phone=user_profile.phone1 | |
) | |
list_schedule.append(data) | |
df = pd.DataFrame(list_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
import boto3 | |
from boto.s3.connection import Bucket, Key | |
video_id = request.POST.get('vid_id') | |
video_name = video_id + "_qvga_webm.webm" | |
video_interview = request.FILES['video_interview'] | |
uploaded_file_url = "https://s3.amazonaws.com/yourbubeckt/" | |
filename = 'pass-your-path/' + video_name |
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
# -*- coding: utf-8 -*- | |
""" | |
Sample report generation script from pbpython.com | |
This program takes an input Excel file, reads it and turns it into a | |
pivot table. | |
The output is saved in multiple tabs in a new Excel file. | |
""" |
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
$.ajax({ | |
type: 'POST', | |
url: "/", | |
data: {}, | |
beforeSend: function(XMLHttpRequest) | |
{ | |
//Upload progress | |
XMLHttpRequest.upload.addEventListener("progress", function(evt){ | |
if (evt.lengthComputable) { | |
var percentComplete = evt.loaded / evt.total; |
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
function uploadFile (file) { | |
return new Promise( (resolve, reject) => { | |
const xhr = new XMLHttpRequest() | |
let fd = new FormData() | |
fd.append('the-file', file) | |
xhr.open('post', '/') | |
xhr.onerror = reject | |
xhr.onload = event => { |
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
/** | |
* Simulate a click event. | |
* @public | |
* @param {Element} elem the element to simulate a click on | |
*/ | |
var simulateClick = function (elem) { | |
// Create our event (with options) | |
var evt = new MouseEvent('click', { | |
bubbles: true, | |
cancelable: true, |
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
.container { | |
width: 100vw; | |
height: 100vh; | |
background: #6C7A89; | |
display: flex; | |
flex-direction: row; | |
justify-content: center; | |
align-items: center | |
} |
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
# save message to DB | |
email_track = Message( | |
body=message_body, | |
sender=request.user, | |
recipient=cand.candidate, | |
job=obj, | |
uuid=uuid.uuid4() | |
) | |
_url = '{}{}?uuid={}'.format(settings.CAREER_PAGE_DOMAIN, reverse( |
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 random import randrange | |
from datetime import timedelta | |
from datetime import datetime | |
import pytz | |
def random_date(start, end): | |
""" | |
This function will return a random datetime between two datetime | |
objects. | |
""" |