Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am rosanarufer on github.
* I am rosanarufer (https://keybase.io/rosanarufer) on keybase.
* I have a public key ASDdgB3vfyECu2cHaWjzD-yIaomh9RycGQMO4OwnsXQSQQo
To claim this, I am signing this object:
@RosanaRufer
RosanaRufer / Dates_in_javascript.md
Last active March 16, 2022 15:35
Dates in JavaScript

Day period

A day starts at 00:00:00 A day ends at 23:59:59.99

ISO Format

  • "YYYY-MM-DDTHH:mm:sss.sssZ"
  • Z means the date is in UTC

Creation with a string

  • new Date('2019-06-11') => Creates date in UTC
@RosanaRufer
RosanaRufer / postgres-brew.md
Last active June 21, 2021 11:03 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
class Email:
@classmethod
def from_text(cls, address):
if '@' not in address:
raise ValueError("Eamil address must contain '@'")
local_part, _, domain_part = address.partition('@')
return cls(local_part, domain_part)
def __init__(self, local_part, domain_part):
#!/bin/bash
count=`git tag -l | wc -l`
keep=20
num=0
for t in `git tag -l --sort=taggerdate`
do
if [ "$num" -ge `expr $count - $keep` ]
then
@RosanaRufer
RosanaRufer / A JavaScript Iterator
Created February 20, 2019 08:36
A JavaScript Iterator
function *dameNumeroFibonacci() {
let a = 0
let b = 1
while(true) {
let c = a + b
a = b
b = c
yield b
}
@RosanaRufer
RosanaRufer / diario_programming_con_picoteo.md
Last active June 29, 2018 11:08
Diario de sesiones de programming con picoteo

28 de Junio de 2018

Asistimos Alicia, Alexandra, Marta y Rosana. Por su simplicidad, decidimos comenzar a implementar este diseño que tenemos empezado en nuestro github del grupo: https://github.com/AdaLoveDev/emojisite.

Nos surgieron dos preguntas

  • La primera relacionada con la semántica HTML. No sabemos cuál es la etiqueta correcta para el sobre-título de "Twemoji". Los recursos sobre semántica que encontramos son muy obstusos...
  • La segunda, la iremos resolviendo después, es cómo hacer el grid de iconos para que se recoloquen correctamente al redimensionar la vista.
<?php
namespace Craft;
class BusinessLogicVariable
{
public function getRequestedLocaleId()
{
// Return the current locale ID if any path is requested
if (craft()->request->getUrl() !== '/') {
return craft()->locale->id;
@RosanaRufer
RosanaRufer / domQueryingService.ts
Created February 13, 2017 15:15
Service for finding first focusable element
namespace settlementDrafts {
export class DOMQueryingService {
public findFirstEnabledElement(form: any): any {
return _.find(form, (element: any) => {
return this.isFocusableElement(element) && this.isEditableElement(element);
});
}
private isFocusableElement(element: any): boolean {
@RosanaRufer
RosanaRufer / override-uibTooltipProvider
Created February 11, 2017 17:56
Hack to configure uibTooltip in config time based on device.
var tooltipFactory = $uibTooltipProvider.$get[$uibTooltipProvider.$get.length - 1];
// decorate the tooltip getter
$uibTooltipProvider.$get[$uibTooltipProvider.$get.length - 1] =
function ( $window, $compile, $timeout, $document, $uibPosition, $interpolate, $rootScope, $parse, $$stackedMap ) {
// for touch devices, don"t return tooltips
if ("ontouchstart" in $window) {
return function () {
return {
compile: function () { }