Skip to content

Instantly share code, notes, and snippets.

View Yemolai's full-sized avatar
👨‍💻
Working from home

Romulo Gabriel Rodrigues Yemolai

👨‍💻
Working from home
View GitHub Profile
@Yemolai
Yemolai / caching.md
Last active February 14, 2020 12:46

Caching your GitHub password in Git

If you're cloning GitHub repositories using HTTPS, you can use a credential helper to tell Git to remember your GitHub username and password every time it talks to GitHub.

Tip: You need Git 1.7.10 or newer to use the credential helper.

Turn on the credential helper so that Git will save your password in memory for some time. By default, Git will cache your password for 15 minutes.

@Ciantic
Ciantic / example-typeorm-jest.test.ts
Created April 16, 2019 17:50
Example of testing TypeOrm with Jest and Sqlite in-memory database
import { createConnection, getConnection, Entity, getRepository } from "typeorm";
import { PrimaryGeneratedColumn, Column } from "typeorm";
@Entity()
export class MyEntity {
@PrimaryGeneratedColumn()
id?: number;
@Column()
name?: string;
@steveholgado
steveholgado / - vuejs-sass-environment-variables.md
Created January 16, 2019 20:25
Make environment variables available as Sass variables in Vue.js

Vue.js: Environment variables in Sass

Make environment variables available as Sass variables in Vue.js.

@asoorm
asoorm / docker-compose-mongo-replicaset.yml
Created September 14, 2018 19:00
Mongo Replica Set docker compose
version: "3"
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo:4.0-xenial
expose:
- 27017
ports:
- 27011:27017
@VitorLuizC
VitorLuizC / README.md
Last active April 14, 2019 03:08
Operadores e "hacks"

&&

const response = await fetch('https://app.io/user/187927981')
// { data: { user: { name: 'Vitor' } } }

const name = response && response.data && response.data.user && response.data.user.name
// 'Vitor'
@apisandipas
apisandipas / share-urls.md
Last active May 9, 2024 15:31 — forked from chrisjlee/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active June 21, 2024 14:51
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@boliveirasilva
boliveirasilva / phoneValidate_BR.php
Created October 14, 2015 16:11
Regex para validação de telefones (celular ou fixo) no Brasil. A expressão leva em conta o formato internacional/nacional, com ou sem o DDD, de telefones fixos e celulares.
<?php
// A função abaixo demonstra o uso de uma expressão regular que identifica, de forma simples, telefones válidos no Brasil.
// Nenhum DDD iniciado por 0 é aceito, e nenhum número de telefone pode iniciar com 0 ou 1.
// Exemplos válidos: +55 (11) 98888-8888 / 9999-9999 / 21 98888-8888 / 5511988888888
function phoneValidate($phone)
{
$regex = '/^(?:(?:\+|00)?(55)\s?)?(?:\(?([1-9][0-9])\)?\s?)?(?:((?:9\d|[2-9])\d{3})\-?(\d{4}))$/';
if (preg_match($regex, $phone) == false) {
@Yimiprod
Yimiprod / difference.js
Last active June 20, 2024 08:26
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {