A vanilla javascript photo gallery plugin inspired by Google Photos.
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
| var today = new Date(); | |
| Date.prototype.stdTimezoneOffset = function() { | |
| var jan = new Date(this.getFullYear(), 0, 1); | |
| var jul = new Date(this.getFullYear(), 6, 1); | |
| return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); | |
| } | |
| Date.prototype.dst = function() { | |
| return this.getTimezoneOffset() < this.stdTimezoneOffset(); |
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
| How to Completely Remove Android Studio | |
| Execute these commands from the terminal | |
| rm -Rf /Applications/Android\ Studio.app | |
| rm -Rf ~/Library/Preferences/AndroidStudio* | |
| rm ~/Library/Preferences/com.google.android.studio.plist | |
| rm -Rf ~/Library/Application\ Support/AndroidStudio* | |
| rm -Rf ~/Library/Logs/AndroidStudio* |
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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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 com.foo.bar.receiver | |
| import android.content.Context | |
| import timber.log.Timber | |
| import java.util.* | |
| class CallReceiver : PhonecallReceiver() { | |
| override fun onIncomingCallReceived(ctx: Context, number: String, start: Date) { | |
| Timber.d("onIncomingCallReceived: $number") |
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 android.content.Context; | |
| import android.util.Log; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.widget.BaseAdapter; | |
| import android.widget.Filter; | |
| import android.widget.Filterable; | |
| import android.widget.TextView; |
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
| docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
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
| DELIMITER $$ | |
| CREATE FUNCTION `haversine` (lat1 DECIMAL(8,6), lng1 DECIMAL(8,6), lat2 DECIMAL(8,6), lng2 DECIMAL(8,6)) RETURNS DECIMAL(8,6) | |
| BEGIN | |
| DECLARE R INT; | |
| DECLARE dLat DECIMAL(30,15); | |
| DECLARE dLng DECIMAL(30,15); | |
| DECLARE a1 DECIMAL(30,15); | |
| DECLARE a2 DECIMAL(30,15); | |
| DECLARE a DECIMAL(30,15); | |
| DECLARE c DECIMAL(30,15); |
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
| @Converter(autoApply = true) | |
| public class LocalDateAttributeConverter implements AttributeConverter<LocalDate, Date> { | |
| @Override | |
| public Date convertToDatabaseColumn(LocalDate locDate) { | |
| return (locDate == null ? null : Date.valueOf(locDate)); | |
| } | |
| @Override | |
| public LocalDate convertToEntityAttribute(Date sqlDate) { |
NewerOlder