This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"database/sql" | |
"encoding/csv" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"sync" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Method for taking a string formatted as a css selector and breaking it down into id/classes/attributes/in-line styles | |
* to use in the creatin of an element. I.E. "#id.class.class2[attribute=value]{ border: 1px solid blue; }" | |
* | |
* @ignore this is the original regex i wrote, which was awesome, but broke on some edge cases ... | |
* "!(\#(.+?)(\.|\[|\{)){1,}!" => ' id="$2" $3', //ID | |
* "!(\.(.*?)(\[|\{)){1,}!" => ' class="$2" $3', //CLASS | |
* "!\[(.*?)=([^\[]*)\]!" => ' $1="$2" ', //ATTRS | |
* "!\{(.*)\}!" => ' style="$1" ', //INLINE STYLE | |
* "!\.([a-zA-Z_]+[\w\-]*)!" => ' $1', //SPECIFIC CLASSES |