Bin e padrões para validação de cartão de crédito.
Bandeira | Começa com | Máximo de número | Máximo de número cvc |
---|---|---|---|
Visa | 4 | 13,16 | 3 |
Mastercard | 5 | 16 | 3 |
''' | |
Problems: Given list of sequence number from 1 to n. Generate lists of all possible permutation with | |
repeated element. For example : | |
[1,2] => [1,1], [1,2], [2,1], [2,2] | |
[1,2,3] => [1,1,1], [1,1,2], [1,1,3], [1,2,1], [1,2,2], [1,3,3], [1,3,1], [1,3,2], [1,3,3], | |
[2,1,1], [2,1,2], [2,1,3], [2,2,1], [2,2,2], [2,3,3], [2,3,1], [2,3,2], [2,3,3], | |
[3,1,1], [3,1,2], [3,1,3], [3,2,1], [3,2,2], [3,3,3], [3,3,1], [3,3,2], [3,3,3], | |
''' |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
Short excursion into git --track
, --set-upstream
and --set-upstream-to
.
All examples use the aliases co
for checkout
and br
for branch
.
Setup:
$ git clone git@github.com:AKSW/OntoWiki.git
write-Host "*******Decrapifying Windows 10...*******" | |
write-Host "***Removing App Packages...***" | |
#I recommend running this script on a fresh install, though it should work fine anyways. Should ;) | |
#This part removes all the apps. By default, it removes every except the calculator and the store. To remove all apps, comment out this part... | |
Get-AppxPackage -AllUsers | where-object {$_.name -notlike "*Microsoft.WindowsStore*"} | where-object {$_.name -notlike "*Microsoft.WindowsCalculator*"} | Remove-AppxPackage | |
Get-AppxProvisionedPackage -online | where-object {$_.packagename -notlike "*Microsoft.WindowsStore*"} | where-object {$_.packagename -notlike "*Microsoft.WindowsCalculator*"} | Remove-AppxProvisionedPackage -online |
I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.
There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*
, e.g.:
:vs **/*<partial file name><Tab>
It's a common confusion about terminal colours... Actually we have this:
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
KDE's document viewer Okular renders
markdown as HTML
(and reloads it automatically on changes.) Thus, simply open the
markdown file currently edited in Vim in Okular to be all set!
To start an GUI application from Vim, without freezing, hit-<enter>
prompts or scrambling screen lines, one can add a command such as
if has('unix')
command! -complete=shellcmd -nargs=1 -bang Silent execute ':silent !' . (0 ? 'nohup ' . . '/dev/null 2>&1 &' : ) | execute ':redraw!'
[alias] | |
ci = commit | |
co = checkout | |
cm = checkout master | |
cb = checkout -b | |
st = status -sb | |
sf = show --name-only | |
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30 | |
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u}) | |
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..) |