Skip to content

Instantly share code, notes, and snippets.

View alanyoshida's full-sized avatar
🐝

Alan Yoshida alanyoshida

🐝
View GitHub Profile
@alanyoshida
alanyoshida / add-team-to-repos.js
Created June 30, 2021 13:04 — forked from davidrleonard/add-team-to-repos.js
Add a new team to all Github repos in an organization
/*
* Adds a team to all the repos in a Github organization. This is a tedious
* process in the UI. You'll need a newer version of node to run this (e.g 9+)
* because it uses async/await.
*
* Instructions:
*
* 1. Copy this file somewhere on your computer, e.g. ~/addteamrepos.js
* 2. Fill in the uppercase variables below with the right values
* 3. Run this file: `$ node ~/addteamrepos.js`
@alanyoshida
alanyoshida / main.go
Created April 19, 2020 19:37 — forked from julz/main.go
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
set nocompatible " be iMproved, required
filetype off " required
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
@alanyoshida
alanyoshida / JSLambda.js
Last active September 2, 2016 12:23
Javascript Lambda Functions
/* ES5 */
var adder = function(x){
return function(y){
return x+y;
};
}
adder(5)(5)
// 10
@alanyoshida
alanyoshida / currying.js
Created July 30, 2016 19:35
Exemplo de Currying com JS
var filmes = [
{ name: 'Matrix', genero: 'acao'}
,{ name: 'Mad Max', genero: 'acao'}
,{ name: 'Interestelar', genero: 'ficcao cientifica'}
,{ name: 'A origem', genero: 'ficcao cientifica'}
,{ name: 'Seven', genero: 'policial'}
];
var hasGenero = function(genero){
return function(obj){
@alanyoshida
alanyoshida / plugin.js
Created May 17, 2016 16:39
Estrutura básica para um plugin Javascript
// IIFE - Immediately Invoked Function Expression
// Serve para criar um contexto de execução e proteger as Variaveis / Funcoes / Obj e nao deixar elas em contexto global.
;(function(global, $) {
// 'new' gera um objeto vazio.
// Esse é o metodo construtor, que chama outro metodo o: init e retorna o objeto.
var PluginName = function(variable1, variable2) {
// Isso faz com que o plugin possa ser usado sem precisar ficar dando new
return new PluginName.init(variable1, variable2);
}
@alanyoshida
alanyoshida / JSlibraries.md
Last active May 8, 2016 21:36
Bibliotecas JS
@alanyoshida
alanyoshida / gitcomandos.md
Created October 15, 2015 13:04
GIT - COMANDOS MAIS USADOS

#GIT

ADICIONA TODOS OS ARQUIVOS PARA SEREM COMMITADOS

git add .

FAZ COMMIT COM UMA MENSAGEM

git commit -m "Mensagem"

VER STATUS DOS ARQUIVOS

git status

@alanyoshida
alanyoshida / ipsec.md
Last active February 10, 2017 20:03
IPSEC

IPSEC

Inicia o serviço

service ipsec start

Restarta o serviço

service ipsec restart

Faz releitura do arquivo secrets

ipsec auto --rereadsecrets