Skip to content

Instantly share code, notes, and snippets.

View MrCordeiro's full-sized avatar
:shipit:
In a love-hate relationship with white spaces

Fernando MrCordeiro

:shipit:
In a love-hate relationship with white spaces
View GitHub Profile
@MrCordeiro
MrCordeiro / factories.py
Created February 23, 2020 17:25
Using factory-boy to create users with permissions in Django Tests
""" Holds all factories used in this app's test suite """
import factory
from django.contrib.auth import get_user_model
User = get_user_model()
def get_or_create_xxx_group():
@MrCordeiro
MrCordeiro / remove-last-row-from-table.html
Created March 2, 2020 15:50 — forked from rootbear/remove-last-row-from-table.html
Javascript: Remove Last Row from Table
<html>
<head>
<title>remove last row from a table</title>
<script language="JavaScript" type="text/javascript">
<!--
var rws;
function RemoveRow(obj){
obj=document.getElementById(obj);
rws=obj.getElementsByTagName('TR');
obj.removeChild(rws[rws.length-1]);
@MrCordeiro
MrCordeiro / list_github_repos.py
Last active March 13, 2020 13:47
Lists public repos from an user
import csv
import requests
def list_github_repos(user_name):
"""
Lists public repositories for the specified user.
Args:
user_name (str): user whose repos you want listed
"""
@MrCordeiro
MrCordeiro / what-a-strange-repo.5.gif
Created May 28, 2020 12:08
Gist for what-a-strange-repo.5.gif. Generated by `crop-github-images-cli`.
what-a-strange-repo.5.gif
@MrCordeiro
MrCordeiro / what-a-strange-repo.0.gif
Created May 28, 2020 12:08
Gist for what-a-strange-repo.0.gif. Generated by `crop-github-images-cli`.
what-a-strange-repo.0.gif
@MrCordeiro
MrCordeiro / what-a-strange-repo.2.gif
Created May 28, 2020 12:08
Gist for what-a-strange-repo.2.gif. Generated by `crop-github-images-cli`.
what-a-strange-repo.2.gif
@MrCordeiro
MrCordeiro / what-a-strange-repo.4.gif
Created May 28, 2020 12:08
Gist for what-a-strange-repo.4.gif. Generated by `crop-github-images-cli`.
what-a-strange-repo.4.gif
@MrCordeiro
MrCordeiro / what-a-strange-repo.1.gif
Created May 28, 2020 12:08
Gist for what-a-strange-repo.1.gif. Generated by `crop-github-images-cli`.
what-a-strange-repo.1.gif
@MrCordeiro
MrCordeiro / what-a-strange-repo.3.gif
Created May 28, 2020 12:08
Gist for what-a-strange-repo.3.gif. Generated by `crop-github-images-cli`.
what-a-strange-repo.3.gif
@MrCordeiro
MrCordeiro / timer.js
Created January 23, 2021 16:35
timer-progress-bar
/**
* Displays the remaining time before date
*/
timer = function () {
// Set the date we're counting down to
const startDate = new Date(Date.UTC(2020, 9, 5));
const endDate = new Date(Date.UTC(2021, 0, 15));
const now = new Date();
const timeTotal = endDate - startDate;
const timeLeft = endDate - now;