Skip to content

Instantly share code, notes, and snippets.

View ZackStone's full-sized avatar
⚠️
Loading...

Zack Stone ZackStone

⚠️
Loading...
View GitHub Profile
@ZackStone
ZackStone / random-true-flag.cs
Last active December 18, 2015 16:52
Random true flag
[Flags]
public enum CharType
{
Number = 0x0,
Upper = 0x1,
Lower = 0x2
}
public CharGenerator(CharType charType)
{
@ZackStone
ZackStone / cao.py
Last active March 4, 2016 00:26
Considere um cão treinado. Este cão pode carregar 1 pen drive de 21 gigabytes e correr a uma velocidade constante de 18 km/h. Para que intervalo de distância o cão terá uma taxa de dados mais alta que uma lista de transmissão cuja a taxa de dados é de 150 Mbps?
#!/usr/bin/python
# -*- coding: utf-8 -*-
print ''
cao_gBps = 21.0 # GB por hora
# * 1024 => MB por hora
# * 8 => Mb por hora
# / 60 => Mb por minuto
private DateTime[] StartTime;
private void ContaTempo(int i)
{
if (StartTime[i] == DateTime.MinValue)
{
StartTime[i] = DateTime.Now;
}
else
@ZackStone
ZackStone / gist:b73b6f60aa36fc9be60d59acd7fee38b
Last active April 28, 2016 13:54 — forked from bergantine/gist:5243223
CSS grayscale filter (go from grayscale to full color on hover) #css #sethneilson
img:hover {
-webkit-filter: grayscale(0%);
-webkit-transition: .5s ease-in-out;
-moz-filter: grayscale(0%);
-moz-transition: .5s ease-in-out;
-o-filter: grayscale(0%);
-o-transition: .5s ease-in-out;
}
img {
@ZackStone
ZackStone / copy-and-verify-tree-dir-and-files.sh
Created July 16, 2016 21:39 — forked from anonymous/copy-and-verify-tree-dir-and-files.sh
Copia uma árvore de diretórios e seus arquivos. Conferir as diferenças entre duas árvores de diretórios.
# caminhar até o diretório para que a cópia não saia com o caminho completo
# (a cópia tera o caminho a partir do diretório atual do terminal)
cd /a/b/c/dir
# Copia os arquivos que foram modificados nos últimos X (30) dias
# (e seu caminho, a partir do diretorio atual do terminal)
find . -mtime -30 -exec cp --parents \{\} /x/y/z/novo-dir/ \;
# Verificar arquivos diferentes em uma árvore de diretórios
diff --brief -Nr dir1/ dir2/
function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
}
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 8 21:21:59 2017
@author: yitzhak
"""
# pip install --upgrade watson-developer-cloud
@ZackStone
ZackStone / git-tag-delete-local-and-remote.sh
Created August 30, 2017 13:00 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
$(document).ajaxSuccess(function (event, jqXHR, ajaxSettings) {
function extrairUrlRedirecionamento(jqXHR) {
try {
var dados = $.parseJSON(jqXHR.responseText);
if (dados == null) {
return null;
}
if (dados.RedirecionarPara == null) {
@ZackStone
ZackStone / teste-decorator.py
Created December 11, 2017 17:37
teste decorator python
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 16 09:20:32 2017
@author: yitzhak.andrade
"""
class Decorator:
def verificacao(parametro):