Skip to content

Instantly share code, notes, and snippets.

@anoopsankar
anoopsankar / UnicodeFlag.swift
Created Jul 7, 2021
Find Unicode / Emoji flag based on country code in Swift 5
View UnicodeFlag.swift
func unicodeFlag(countryCode: String) -> String {
// expects a 2-letter ISO code of the country
// Unicode flags are generated by taking the 2 letter ISO code of the country
// and mapping them to the regional indicator symbols. Font ligatures are used
// to make them into a single glymph. A more detailed explanation is available
// here -> https://esham.io/2014/06/unicode-flags
// This code is based on this stackoverflow answer for Java
// https://stackoverflow.com/questions/30494284/android-get-country-emoji-flag-using-locale/35849652#35849652
View keybase.md

Keybase proof

I hereby claim:

  • I am anoopsankar on github.
  • I am anoop (https://keybase.io/anoop) on keybase.
  • I have a public key whose fingerprint is F892 85B1 B4F8 C9D2 AB79 D9D6 4EB3 E874 8C30 06FD

To claim this, I am signing this object:

@anoopsankar
anoopsankar / PKCSSigner.java
Last active Dec 11, 2015
PKCS#1 digital signature
View PKCSSigner.java
private byte[] sign(byte[] data, PrivateKey privateKey) throws GeneralSecurityException {
Security.addProvider(new BouncyCastleProvider());
Signature signer = Signature.getInstance("SHA1withRSA", "BC");
signer.initSign(privateKey);
signer.update(data);
return signer.sign();
}
View css-flicker.html
<!DOCTYPE html>
<html>
<head>
<title>Flickering Text</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
View flicker-text.css
#text-block .flickr {
color: transparent;
text-shadow: white 0 0 1px;
-webkit-transition: text-shadow 0.2s ease-in-out;
-moz-transition: text-shadow 0.2s ease-in-out;
transition: text-shadow 0.2s ease-in-out;
}