Skip to content

Instantly share code, notes, and snippets.

View diogoalexsmachado's full-sized avatar

Diogo Machado diogoalexsmachado

View GitHub Profile
INSTALLATION
sudo cp ddclient /usr/sbin/
sudo mkdir /etc/ddclient
sudo mkdir /var/cache/ddclient
sudo cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
sudo nano /etc/ddclient/ddclient.conf
CONFIG FILE
package com.teste.app;
public class Main {
public static void main(String[] args) {
int[][] nums = {{ 1, 2, 3, 4},
{ 5, 6, 7, 8},
{ 9, 10, 11, 12},
{13, 14, 15, 16}};
package com.teste.app;
public class Main {
public static void main(String[] args) {
int[][] nums = {{ 1, 2, 3, 4},
{ 5, 6, 7, 8},
{ 9, 10, 11, 12},
{13, 14, 15, 16}};
@ECHO OFF
COLOR 1F
SET V=1.7
TITLE Windows 10 Registry tweaks for mining (x64) by: jsanzsp
REM ======================= Registry tweaks =======================
ECHO.
:regstart
set /p registry="Apply Registry tweaks? y/n: "
if '%registry%' == 'n' goto servstart
if /i "%registry%" neq "y" goto regstart
public class NISSValidator {
private NISSValidator() {
}
/**
* Validates if a given string niss is valid.
*
* @param niss number to validate
* @return true if the input is valid and false otherwise
/*******************************************
* STRING RELATED FUNCTIONS *
* FROM http://stackoverflow.com/a/1144788 *
*******************************************/
function escapeRegExp(string) {
return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
}
function replaceAll(find, replace, str) {
function validarNISS() {
var niss = $("#inputNISS").val();
//deve ter 11 dígitos
if(niss.length != 11) {
swal("Aviso", "O número de Segurança Social deverá ter 11 dígitos.", "warning");
} else {
var FACTORS = [29, 23, 19, 17, 13, 11, 7, 5, 3, 2];
var nissArray = [];
for (var i = 0; i < niss.length; i++) {
#!/bin/bash
git clone https://github.com/artf/grapesjs-preset-webpage.git && cd grapesjs-preset-webpage
npm i
npm i grapesjs --no-save
npm start
# No inicio.jsp
<input type="hidden" id="controloAlteracoes" value="0">
# no acesso.js (chamado no inicio.jsp)
$("#controloAlteracoes").change(function () {
if ($(this).val() == 1) {
toastr.clear();
toastr["info"]("Existem informações não guardadas", "Atenção", {
"closeButton": true,
"debug": false,
@diogoalexsmachado
diogoalexsmachado / matrix.sh
Created December 19, 2018 10:31
useless but funny :)
#!/bin/bash
#
# matrix: matrix-ish display for Bash terminal
# Author: Brett Terpstra 2012 <http://brettterpstra.com>
# Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/>
#
# A morning project. Could have been better, but I'm learning when to stop.
### Customization:
blue="\033[0;34m"