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
mysqldump -u USER -p --single-transaction --quick --lock-tables=false DATABASE | gzip > OUTPUT.gz |
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
// Add the following code to the top of onCreate in your launcher Activity. | |
// --- | |
// By default OneSignal calls startActivity with the following intent flags: | |
// Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK | |
private static boolean activityStarted; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
<input type="password" autocomplete="new-password"> |
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
public class VerticalSpaceItemDecoration extends RecyclerView.ItemDecoration { | |
private final int verticalSpaceHeight; | |
public VerticalSpaceItemDecoration(int verticalSpaceHeight) { | |
this.verticalSpaceHeight = verticalSpaceHeight; | |
} | |
@Override | |
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, |
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
I'll use port 9005 instead standard 9000 to avoid conflicts with other applications. | |
Client Side (Host with Atom): | |
1) Download php-debug | |
2) Configure php-debug : Server: 10.254.254.254 - Port: 9005 - Pathmaps : add "/" at the end of path to include all subfolders | |
3) Enable php-debug panel inside Atom with CTRL+ALT+D (or clicking bottom left button "PHP Debug" | |
4) Make lo0 alias: ifconfig lo0 alias 10.254.254.254 | |
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
extension UIView { | |
class func fromNib<T: UIView>() -> T { | |
return Bundle.main.loadNibNamed(String(describing: T.self), owner: nil, options: nil)![0] as! T | |
} | |
} | |
//Then call it like this: | |
let myCustomView: CustomView = UIView.fromNib() | |
//..or even: |
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
<?xml version="1.0" encoding="utf-8"?> | |
<paths xmlns:android="http://schemas.android.com/apk/res/android"> | |
<external-path name="external_files" path="."/> | |
</paths> |
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
typealias IMG_VIEW_REQUESTS_TYPE = [ UIImageView : [String] ] | |
private struct AssociatedKey { | |
static var imgViewRequests = "imageCache_imgViewRequests" | |
} | |
var imgViewRequests : IMG_VIEW_REQUESTS_TYPE { | |
get { | |
return objc_getAssociatedObject(self, &AssociatedKey.imgViewRequests) as! SmartSingleton.IMG_VIEW_REQUESTS_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
<Directory "/path-to-protected"> | |
AuthType Basic | |
AuthName "auth" | |
AuthUserFile "/auth-user-file-path" | |
require valid-user | |
SetEnvIf Request_URI "path-to-allow" allowed_restricted | |
Order allow,deny |
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 myapp; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
import okhttp3.Headers; | |
import okhttp3.Interceptor; | |
import okhttp3.MediaType; | |
import okhttp3.Request; | |
import okhttp3.Response; | |
import okhttp3.ResponseBody; |