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
db.getCollection('COLL_NAME').update({},{$unset: {FIELD_NAME:1}},{multi: true}); |
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
import java.io.BufferedReader; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.zip.GZIPInputStream; | |
import java.util.zip.GZIPOutputStream; | |
public class Gzip { |
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
Using "requireCordovaModule" to load non-cordova module "glob" is not supported. | |
Fix: Downgrade cordova to 8.1.2: | |
npm install -g [email protected] |
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
/** | |
* | |
* @author https://stackoverflow.com/users/1964272/dropout | |
*/ | |
public static String compress(String str) throws IOException { | |
if (str == null || str.length() == 0) { | |
return str; | |
} | |
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |
GZIPOutputStream gzip = new GZIPOutputStream(out); |
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
let win: any = window; | |
path = win.Ionic.WebView.convertFileSrc(path); |
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
~$ loginctl | |
-> get session | |
~$ loginctl show-session SESSION -p Type | |
-- OR | |
~$ echo $XDG_SESSION_TYPE |
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
<build> | |
<plugins> | |
<plugin> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<configuration> | |
<archive> | |
<manifest> | |
<mainClass>fully.qualified.MainClass</mainClass> | |
</manifest> | |
</archive> |
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
<!-- Configures Proguard obfuscation tool to generate an | |
obfuscated version of the JAR file that replaces the | |
default unobfuscated JAR. | |
-- author: Emily Mabrey @ https://stackoverflow.com/questions/34706466/how-do-i-use-proguard-obfuscation-while-building-a-maven-plugin-package | |
--> | |
<plugin> | |
<groupId>com.github.wvengen</groupId> | |
<artifactId>proguard-maven-plugin</artifactId> | |
<version>2.0.13</version> |
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
String text = "age: 28,favorite number: 26,\"salary: $1,234,108\""; | |
String[] strArray = text.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)"); | |
for (String s : strArray) { | |
s = s.replaceAll("\"", ""); | |
} |
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
Number query example: 400105 | |
db.getCollection('COLLECTION_NAME').find({ $where: "/^400105.*/.test(this.FIELD_TO_MATCH)"}) |