Skip to content

Instantly share code, notes, and snippets.

package facebook;
import java.util.HashSet;
import java.util.Set;
/**
* The complexity of that algorithm is O(n^m), where:
* n - the length of a string.
* m - number of permutations.
*/
@coderiff
coderiff / gist:75ddbfa3091009aabd60
Last active April 26, 2024 07:15
Excel macro for pasting into visible cells only
' Excel does not allow pasting to visible cells only when using filter.
' Use below macro to paste into visible cells.
'
' Data to copy need to be in the same sheet.
' Select the cells to copy then run the macro.
' It will ask for a paste range, specify the cell range to paste into.
' Source code taken from: http://www.mrexcel.com/forum/excel-questions/85288-paste-visible-cells-only-3.html#post3448596
Sub Copy_Filtered_Cells()
Set from = Selection
[{"name":"Afghanistan","alpha-3":"AFG","country-code":"004"},{"name":"Åland Islands","alpha-3":"ALA","country-code":"248"},{"name":"Albania","alpha-3":"ALB","country-code":"008"},{"name":"Algeria","alpha-3":"DZA","country-code":"012"},{"name":"American Samoa","alpha-3":"ASM","country-code":"016"},{"name":"Andorra","alpha-3":"AND","country-code":"020"},{"name":"Angola","alpha-3":"AGO","country-code":"024"},{"name":"Anguilla","alpha-3":"AIA","country-code":"660"},{"name":"Antarctica","alpha-3":"ATA","country-code":"010"},{"name":"Antigua and Barbuda","alpha-3":"ATG","country-code":"028"},{"name":"Argentina","alpha-3":"ARG","country-code":"032"},{"name":"Armenia","alpha-3":"ARM","country-code":"051"},{"name":"Aruba","alpha-3":"ABW","country-code":"533"},{"name":"Australia","alpha-3":"AUS","country-code":"036"},{"name":"Austria","alpha-3":"AUT","country-code":"040"},{"name":"Azerbaijan","alpha-3":"AZE","country-code":"031"},{"name":"Bahamas","alpha-3":"BHS","country-code":"044"},{"name":"Bahrain","alpha-3":"BHR",