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
| server { | |
| listen 80 default_server; | |
| server_name example.com www.example.com; | |
| access_log /srv/www/example.com/logs/access.log; | |
| error_log /srv/www/example.com/logs/error.log; | |
| root /srv/www/example.com/public; | |
| index index.php index.html; |
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
| // download zipfile | |
| func ZipHandler(w http.ResponseWriter, r *http.Request) { | |
| vars := mux.Vars(r) | |
| token := vars["token"] | |
| db, err := sql.Open("mysql", config.DSN) | |
| if err != nil { | |
| panic(err.Error()) // Just for example purpose. You should use proper error handling instead of panic | |
| } |
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
| - (void)viewDidAppear:(BOOL) animated { | |
| [super viewDidAppear:animated]; | |
| // Register notification when the keyboard will be show | |
| [[NSNotificationCenter defaultCenter] addObserver:self | |
| selector:@selector(keyboardWillShow:) | |
| name:UIKeyboardWillShowNotification | |
| object:nil]; | |
| // Register notification when the keyboard will be hide | |
| [[NSNotificationCenter defaultCenter] addObserver:self |
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
| // NOTE: This delegate method requires you to disable UICollectionView's `pagingEnabled` property. | |
| - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView | |
| withVelocity:(CGPoint)velocity | |
| targetContentOffset:(inout CGPoint *)targetContentOffset { | |
| CGPoint point = *targetContentOffset; | |
| UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)self.collectionView.collectionViewLayout; | |
| // This assumes that the values of `layout.sectionInset.left` and |