This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# if you want no parents folders at current path, add: --no-parent | |
# if you want no subfolders: --cut-dirs=[n] | |
# if you want no hosts folders: --no-host-directories | |
# ref https://stackoverflow.com/questions/5043239/how-do-i-mirror-a-directory-with-wget-without-creating-parent-directories | |
# Include resources on a different domain: --span-hosts | |
# ref https://superuser.com/questions/129085/make-wget-download-page-resources-on-a-different-domain | |
wget \ | |
--no-clobber \ | |
--convert-links \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function buildSelect($tableStruct){ | |
$queryString = "SELECT "; | |
$queryBinds = array(); | |
$sqlQueryFields = array( | |
"states.id", | |
"states.code", | |
"states.name" | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
let dlStart="$(date +%s)" | |
# do something | |
let dlEnd="$(date +%s)" | |
let diffe="$dlEnd-$dlStart" | |
echo $diffe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import re | |
import sys | |
import getopt | |
import csv | |
import json | |
import string | |
def to_snake_case(name): | |
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -maxdepth 1 \! -iname "." -exec "rename" "s/([A-Za-z0-9])([a-zA-Z0-9]+)/\$1\\L\$2/" {} ";" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First, checks if it isn't implemented yet. | |
if (!String.prototype.format) { | |
String.prototype.format = function() { | |
var args = arguments; | |
return this.replace(/{(\d+)}/g, function(match, number) { | |
return typeof args[number] != 'undefined' | |
? args[number] | |
: match | |
; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void){ | |
char input[32]; | |
printf("Digite alguma coisa: "); | |
fflush(stdout); | |
scanf("%31[^\n]", &input); | |
printf("você digitou: %s\n", input); | |
return EXIT_SUCCESS; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start bin\mysqld.exe --defaults-file=my.ini --standalone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin\mysqladmin.exe -u root shutdown -p |