Skip to content

Instantly share code, notes, and snippets.

ricky rosario rlr

  • Mozilla
  • south florida
Block or report user

Report or block rlr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rlr
rlr / letsencrypt_2018.md
Created Nov 23, 2018 — forked from cecilemuller/letsencrypt_2019.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2018.md

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

View count_contributors.py
# To get the number of support forum contributors:
from datetime import date
from django.db.models import F, Count
from kitsune.questions.models import Answer
start_date =date(2013,1,1)
end_date = date(2014,1,1)
@rlr
rlr / git-url
Created Mar 19, 2013
* copies the commit's github url to your clipboard * prints out the log message * opens the bugzilla page if it found a bug number
View git-url
#!/bin/sh
# Usage: `git url` or `git url <commitish>`
#
# * copies the commit's github url to your clipboard
# * prints out the log message
# * opens the bugzilla page if it found a bug number
#
# Set up the github url with `git config github.url <url>`.
# Only for the Mac.
@rlr
rlr / surveygizmo.py
Created Mar 8, 2013
Grab emails from SUMO's email collection survey and add them to the Exit Survey email campaign.
View surveygizmo.py
#!/usr/bin/env python
import json
import optparse
import sys
from datetime import datetime
try:
import requests
except ImportError:
@rlr
rlr / get_contributors.py
Last active Dec 11, 2015
Get webdev contributors, # of contributions and contributed repos as a CSV.
View get_contributors.py
# Requirements:
# pip install requests==1.1.0
import requests
repos = [
'bedrock',
'django-browserid',
'input.mozilla.org',
@rlr
rlr / 72h.sql
Created Jan 8, 2013
SQL for questions answered in 72hours
View 72h.sql
SELECT
(extract( year from created )) AS `year`,
(extract( day from created )) AS `day`,
(extract( month from created )) AS `month`,
COUNT(`questions_question`.`created`) AS `count`
FROM `questions_question`
INNER JOIN `auth_user`
ON (`questions_question`.`creator_id` = `auth_user`.`id`)
WHERE (`auth_user`.`is_active` = 1
AND `questions_question`.`created` >= '2011-01-01 00:00:00'
@rlr
rlr / fabfile.py
Created May 17, 2012
fabfile for getting new db dump
View fabfile.py
from fabric.api import local
def get_db_dump():
local('scp username@host.mozilla.org:/data/www/sumodump.sql.gz .')
local('gunzip sumodump.sql.gz')
def load_dump():
local('mysql -e "DROP DATABASE kitsune;"')
local('mysql -e "CREATE DATABASE kitsune;"')
local('mysql kitsune < sumodump.sql')
@rlr
rlr / bugzilla.mozilla.org.js
Created Jan 27, 2012
dotjs'ified bugzilla agile for hackability.
View bugzilla.mozilla.org.js
var settings = {
agile_backlog: true
};
var css = ".graph { width: 300px; height: 300px; float: left; } .graph canvas.overlay { background: none repeat scroll 0 0 rgba(0, 0, 0, 0) !important; }";
$('head').append($('<style>').text(css));
function agileBacklog() {
if(settings.agile_backlog) {
var $wb = $('td.bz_status_whiteboard_column');
@rlr
rlr / interpreter
Created Sep 21, 2011
GenericRelation test case
View interpreter
In [1]: from testapp.models import ModelA
In [2]: a = ModelA.objects.all()[0]
In [3]: a.my_related_cs
Out[3]: <django.db.models.fields.related.RelatedManager object at 0x101e1ca10>
In [4]: a.my_related_bs
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
@rlr
rlr / ISO8601.js
Created Aug 12, 2010
Date.prototype.setISO8601()
View ISO8601.js
// from http://delete.me.uk/2005/03/iso8601.html
Date.prototype.setISO8601 = function (string) {
var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
"(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
var d = string.match(new RegExp(regexp));
var offset = 0;
var date = new Date(d[1], 0, 1);
You can’t perform that action at this time.