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
#To start MySQL: | |
$ sudo mysql.server start | |
#To stop MySQL: | |
$ sudo mysql.server stop | |
#To restart MySQL: | |
$ sudo mysql.server restart |
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
#Instead use "mysql -u root -p" and put your sudo password and mysql password use this expect script: | |
#!/usr/bin/expect -f | |
#create an alias sql="/Users/macbookpro/Desktop/myProject/mysql-enter.sh" | |
#To know more about expect: http://www.admin-magazine.com/Articles/Automating-with-Expect-Scripts | |
spawn mysql -u root -p | |
expect { | |
"Password:" { | |
send "sudo_password\r" | |
} |
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
#!/bin/bash | |
while : | |
do | |
Time=`date +%r` | |
Date=`date +"%d-%m-%Y"` | |
if [ $Date == '11-05-2017' ] && [ $Time == '15:25:00' ]; then | |
notify-send -i /home/aipi/Pictures/image.jpg 'MASSAGEM' 'Partiu ficar suave?'; |
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
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.test import TestCase | |
class (TestCase): | |
def setUp(self): | |
self.superuser = User.objects.create_superuser( | |
email='[email protected]', | |
password='V&ryD@f3Pwd', | |
name='Super User') |
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
from django.conf.urls import urlpatterns | |
from django.core.urlresolvers import set_urlconf, resolve, reverse | |
os.eviron.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings') | |
def index(request): pass | |
def auth(request): pass | |
def list_(request): pass | |
def edit(request): pass | |
def new(request): pass |
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
{ | |
"python_interpreter": "python3", | |
"anaconda_gutter_theme": "alpha", | |
"anaconda_linter_show_errors_on_save": true, | |
"pep257": false, | |
"aggressive": 2, | |
"pep8_max_line_length": 99, | |
} |
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
from django.test import TestCase | |
from django.core.urlresolvers import resolve | |
from solos.views import index | |
class SolosURLsTestCase(TestCase): | |
def test_root_url_uses_index_view(self): | |
"""Test that | |
the root of the site resolves to the |
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
from django.tesst import TestCase | |
class IndexViewTestCase(TestCase): | |
def setUp(self): | |
self.factory = RequestFactory() | |
def test_index_view_basic(self): | |
"""Test that index view returns a | |
200 response and uses the correct | |
template""" |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int *realoca(int *ptr, int *size) { | |
int add; | |
printf("Insira quantos números quer alocar:\n"); | |
scanf("%d", &add); | |
ptr = (int *) realloc(ptr, (*size + add) * sizeof(int)); |
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
# It is just a example and not completed code | |
from django.http import JsonResponse | |
def ix_detail_pix(request, *args): | |
""" Ajax PIX info if clicked on PIX """ | |
pix_uuid = request.GET['pix'] | |
data = {} | |
pix_infos = get_pix_amounts_info(pix_uuid) |
OlderNewer