One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| # vim: syntax=bash | |
| #!/usr/bin/env bash | |
| ## You will need a .csv with comma-separated values (you can change the separator on awk -F 'separator' line) file with the repo name to Gogs, the GitHub url and a description to your new Gogs repo | |
| ## Example: repo,https://github.com/gogs/go-gogs-client.git,My description | |
| ## To find your Gogs token (if you already created one on your Gogs cliente) you can run this command on Terminal: | |
| ## curl -u 'myuser' mygogsurl/api/v1/users/myuser/tokens | |
| ## You will receive a json output, and then, copy the token and paste on 'GOGS_TOKEN' variable replancing '#' symbol |
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: gogs | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Git repository manager Gogs | |
| # Description: Starts and stops the self-hosted git repository manager Gogs | |
| ### END INIT INFO |
| # Preenche as linhas NaN com 0 para fazer a converão de tipos | |
| final[['fone1', 'ddd']] = final[['fone1', 'ddd']].fillna( | |
| '0').astype(float).astype(int).astype(str) | |
| # Substitui as linhas com 0 por None(nulo) | |
| final['fone1'] = final['fone1'].replace({'0': None}) |
| #!/bin/bash | |
| # Create a remote repository using github API | |
| read -p "Type the repo name, and press [ENTER]:" repo_name | |
| read -p "Type repo description, and press [ENTER]:" repo_desc | |
| printf "REPOSITORY NAME: $repo_name\nREPOSITORY DESCRIPTION: $repo_desc\n" | |
| # Confirmation |
| function onLoad() { | |
| var ga = new GlideAjax('GetUserData'); | |
| ga.addParam('sysparm_name', 'getData'); | |
| ga.getXML(HelloWorldParse); | |
| function HelloWorldParse(response) { | |
| var answer = response.responseXML.documentElement.getAttribute("answer"); |
| /** | |
| * Build a custom json template from another json. | |
| * | |
| * @param {Object} myObject - Object to be build | |
| * @returns {Object} Builded JSON | |
| * @module buildJson | |
| */ | |
| function buildJson(myObject) { | |
| myObject = Object.keys(myObject).map(function(key, index) { | |
| let newObject = { |
| /** | |
| * Normalize strings to a custom pattern, tempplate | |
| * | |
| * @param {string} myStr - String to be normalized | |
| * @returns {string} Normalized string | |
| */ | |
| function fixStr(myStr) { | |
| return myStr.normalize('NFD') | |
| .replace(/\uFFFD/g, '') | |
| .replace(/[\u0300-\u036f]/g, '') |
| /** | |
| * Constructs an object from a array, using even indexes as key and odd indixes as value | |
| * | |
| * @param {Array} myArray - Array to be transformed | |
| * @returns {Object} | |
| */ | |
| function toObject(myArray) { | |
| let r = {}; | |
| for (let i = 0; i < myArray.length; i += 2) { | |
| let key = (myArray[i]), |
| // FILTER | |
| /* | |
| If i already have an array but i only want to have items in the array that match certain criteria, use the filter. | |
| Quando eu já tenho um array e quero apenas itens no novo array que correspondem a uma condição, use filter. | |
| */ | |
| // GET JUST EVEN NUMBERS | |
| let arr = [-200, -163, -26, -4, 0, 7, 76]; |