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/
@ZackStone
ZackStone / slack-invite-all-members-to-a-channel.js
Created April 14, 2017 13:48
Invite all team members to a Slack channel
/*
https://webapps.stackexchange.com/questions/100820/how-do-i-invite-all-team-members-to-a-new-slack-channel#answer-104062
Instructions: Just browse to the appropriate channel and paste
this script (below) into your Chrome/Firefox dev console and hit enter.
Then wait for the script to run until it completes.
It might take time as there is a limit to how many users may be invited at once.
The script will loop until all team members are invited.
*/
var foundAny=false;
function selectAllByLetter(remainingLetters) {
function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
}
@ZackStone
ZackStone / cntlm.md
Created June 23, 2017 18:19
Como instalar e configurar o Cntlm.

Instalar e configurar o Cntlm

Página de download: https://sourceforge.net/projects/cntlm/files/

Gerar senha criptografada

  • Após a instalação, vá até a pasta em que o software foi instalado (normalmente C:\Program Files (x86)\Cntlm\).
  • Segure o Shift e clique com o botão direto em uma área em branco dentro da pasta, e selecione a opção Abrir janela de comando aqui.
  • No prompt de comando que será aberto, digite cntlm -H. Será pedido sua senha, entre com a senha do Windows (usuário de rede) e tecle enter.
  • Será gerado alguns parâmetros como o trecho abaixo:
#!/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