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
[{"model": "auth.group", "fields": {"name": "Manager", "permissions": [["add_produs", "app", "produs"], ["change_produs", "app", "produs"], ["view_produs", "app", "produs"]]}}, {"model": "auth.user", "fields": {"password": "pbkdf2_sha256$720000$H1Nh9zmRf07llikyOTqiJW$h6LH3AYc7EdfS5/9UW+3jQATqMPHyfI5Lf497JajbGg=", "last_login": "2024-02-20T18:26:20.598Z", "is_superuser": true, "username": "admin", "first_name": "", "last_name": "", "email": "[email protected]", "is_staff": true, "is_active": true, "date_joined": "2024-01-16T17:50:18.780Z", "groups": [], "user_permissions": []}}, {"model": "auth.user", "fields": {"password": "pbkdf2_sha256$720000$Hp9E9OxVS8ULsNFzFH8eP0$lV/1jgU7jysd4WXL3sZY4jbNMzSCXWn47kxNtC1qK8k=", "last_login": "2024-02-08T17:15:39.107Z", "is_superuser": false, "username": "user", "first_name": "", "last_name": "", "email": "", "is_staff": false, "is_active": true, "date_joined": "2024-02-08T17:15:18.608Z", "groups": [], "user_permissions": []}}, {"model": "auth.user", "fields": {"password": "pb |
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 unittest | |
def sort_dicts(dicts): | |
result = [] | |
for index, item in enumerate(dicts, 1): | |
lowest_key = sorted(item.keys())[0] | |
result.append((index, lowest_key, item[lowest_key])) | |
sorted_result = sorted(result, key=lambda x: (x[1], x[2])) | |
return [key[0] for key in sorted_result] |
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
# My git workflow | |
# 1. Who the heck wrote this ?? .. aa me 6 months ago | |
# Track down the whys of weird code ... links to commits -> commit messages -> JIRA (tool of choice) tickets | |
git blame | |
# 2. Q: Hey can we do a quick hotfix? Everything's on fire on production | |
# A: But .. but ... I'm working on a new feature | |
git stash | |
git checkout release-branch | |
git checkout -b hotfix | |
# type away .. work work |
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
#!/usr/bin/env bash | |
# Hard coded hashes. Should change to capturing stdout from hash-object and openssl calls | |
rm -rf .git # cleanup | |
rm test.txt | |
set -x | |
git init | |
# ls -l .git | |
# HEAD -> points to the latest commit (ref) | |
# config -> per repository overrides of global .gitconfig; remote definitions; remote branch mapping definitions | |
# description -> ? |
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 random | |
import string | |
def random_string(length): | |
return ''.join(random.sample(string.ascii_uppercase + string.digits, length)) | |
def random_digits(lengthOfDigits): | |
return ''.join(random.sample(string.digits, lengthOfDigits)) | |
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
Environment variables | |
GITHUB_TOKEN="token" OWNER="ownername" REPO="reponame" | |
Set pending.sh after Source Code Checkout | |
Set complete.sh after Parsing test results as a final task |
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
#include <stdio.h> | |
#include <string.h> | |
long filesize(char * filename){ | |
FILE * f; | |
f=fopen(filename,"rb"); | |
if(!f){ | |
printf("Eroare la deschiderea fisierului %s\n",filename); | |
return 0; | |
} | |
fseek(f,0,SEEK_END); |
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 django.db import connections | |
connection = connections['slave'] | |
connection.cursor.execute("SHOW PROCEDURE STATUS") # This is executed on the slave | |
results = connection.cursor.fetchall() |