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
| // <span data-email="contact"></span> | |
| (function ($, domain) { | |
| // updating email when needed | |
| const elements = $("span[data-email]"); | |
| $.each(elements, function (key, value) { | |
| var email = $(value).data('email'); | |
| value.innerHTML = email + "@" + domain; | |
| }); |
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
| php bin/console server:dump | |
| php bin/console server:dump --format=html > dump.html | |
| // Launch Web server | |
| php bin/console server:run | |
| php bin/console config:dump-reference | |
| php bin/console hautelook:fixtures:load | |
| // Security |
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
| DELIMITER $$ | |
| CREATE FUNCTION `haversine` (lat1 DECIMAL(10,8), lng1 DECIMAL(10,7), lat2 DECIMAL(10,8), lng2 DECIMAL(10,7)) RETURNS DECIMAL(10,7) | |
| 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
| #set ($USER = "user name") | |
| #set ($COMPANY = "Company (R) $YEAR") | |
| #set ($EMAIL = "contact@domain.tld") | |
| /** | |
| * Created by ${USER} on ${DATE}. | |
| * ${COMPANY} | |
| * ${EMAIL} | |
| */ |
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.content.SharedPreferences | |
| import android.preference.PreferenceManager | |
| /** | |
| * | |
| * GET/SET | |
| * val protectAtStart = defaultPrefs(context)["key", "defaultValue"] | |
| * defaultPrefs(context)["key"] = "myValue" | |
| * |
NewerOlder