Skip to content

Instantly share code, notes, and snippets.

View diogomoretti's full-sized avatar
🌎

Diogo Moretti diogomoretti

🌎
View GitHub Profile
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active July 30, 2024 13:21
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@nramirez
nramirez / gulpfile.babel.js
Last active August 17, 2016 12:34
ES6, Gulp, Browserify and React
'use strict';
import source from 'vinyl-source-stream';
import gulp from 'gulp';
import browserify from 'browserify';
import babelify from 'babelify';
import run from 'run-sequence';
import rimraf from 'rimraf';
import shell from 'gulp-shell';
import server from 'gulp-live-server';
@dcalhoun
dcalhoun / default.js
Last active October 22, 2023 12:26
Gulp organization with Gulp 4.0, Babel, and require-dir
'use strict';
import gulp from 'gulp';
import config from '../config';
import browserSync from 'browser-sync';
gulp.task('default', gulp.parallel('html', 'scripts', 'styles', 'server', () => {
gulp.watch(config.paths.html.all, gulp.parallel('html', gulp.series('html', browserSync.reload)));
gulp.watch(config.paths.scripts.all, gulp.parallel('scripts', browserSync.reload));
gulp.watch(config.paths.styles.all, gulp.parallel('styles', browserSync.reload));

Github Two-Factor Authentication (2FA) for Brazil via SMS

The Github doesn't provide country code for Brazil (+55). To add this option, just run the code below in your console. The option Brazil +55 will be the first on the list, already selected:


🇧🇷 [pt-BR]

Autenticação em dois fatores (2FA) do GitHub para o Brasil via SMS

@paulirish
paulirish / bling.js
Last active July 23, 2024 14:51
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@Jiert
Jiert / JavaScript-Tabs.js
Last active November 29, 2023 11:40
Creating Tabs with Vanilla JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<title>Tabs</title>
<style>
.nav .active a { color: red; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
</style>
</head>
@acauamontiel
acauamontiel / mixins.styl
Last active May 5, 2018 12:28
Useful mixins for Stylus
/*
* Clearfix
*/
clearfix()
&:before,
&:after
content ' '
display table
&:after
@cferdinandi
cferdinandi / umd-script-boilerplate.js
Last active December 10, 2023 10:23
A simple boilerplate for UMD JS modules.
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
} else if ( typeof exports === 'object' ) {
module.exports = factory(root);
} else {
root.myPlugin = factory(root);
}
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) {
@danielrohers
danielrohers / app.js
Last active February 13, 2017 13:57
My JavaScript Module Pattern
;(function (w, d, undefined) {
'use strict';
var app = (function () {
var exports = {};
var _privateMethod = function () {
return 'private method';
define([
// jquery core is always required
'jquery/core',
// jquery utilities
'jquery/ajax',
'jquery/data'
], function(jq, ajax, data) {