This file contains 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 void initializePhrases() { | |
Field[] fields = R.string.class.getFields(); | |
loadingPhrasesList = new ArrayList<>(); | |
String requiredIdStart = "loading_window_message_"; // Required string ID. In strings.xml file, the ID of the string must be "loading_window_message_" plus a number from 0 to inifinite (not so long :) | |
for (int i = 0; i < fields.length; i++) { | |
try { | |
String stringIdStart = fields[i].getName().substring(0, idStartText.length()); | |
if (stringIdStart.equals(requiredIdStart)) { | |
loadingPhrasesList.add(fields[i].getName()); | |
} |
This file contains 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
private void animateLayout(boolean mostrar) { | |
AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(this, R.animator.slide_in_up); | |
set.addListener(new Animator.AnimatorListener() { | |
@Override | |
public void onAnimationStart(Animator animation) { | |
} | |
@Override | |
public void onAnimationEnd(Animator animation) { | |
layout.setVisibility(View.GONE); |
This file contains 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
# save it as /etc/profile.d/ssh-telegram.sh | |
# use jq to parse JSON from ipinfo.io | |
# get jq from here http://stedolan.github.io/jq/ | |
USERID="<target_user_id>" | |
KEY="<bot_private_key>" | |
TIMEOUT="10" | |
URL="https://api.telegram.org/bot$KEY/sendMessage" | |
DATE_EXEC="$(date "+%d %b %Y %H:%M")" | |
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt' | |
if [ -n "$SSH_CLIENT" ]; then |
This file contains 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 | |
function get_tls_version($sslversion = null) | |
{ | |
$c = curl_init(); | |
curl_setopt($c, CURLOPT_URL, "https://www.howsmyssl.com/a/check"); | |
curl_setopt($c, CURLOPT_RETURNTRANSFER, true); | |
if ($sslversion !== null) { | |
curl_setopt($c, CURLOPT_SSLVERSION, $sslversion); | |
} |
This file contains 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
# Requirements: imagemagick | |
# Usage: add_text_to_image.sh FileWithTextLines.txt | |
#!/bin/bash | |
COUNTER=1 | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
echo "Text to insert ($COUNTER): $line" | |
convert -pointsize 36 -draw "text 390,135 '$line'" imgsrc.png imgdst$COUNTER.png | |
let COUNTER=COUNTER+1 | |
done < "$1" |
This file contains 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
// Dependencies: [flutter_localizations](https://docs.flutter.dev/development/accessibility-and-localization/internationalization) (Official) | |
MaterialApp( | |
localizationsDelegates: AppLocalizations.localizationsDelegates, | |
supportedLocales: AppLocalizations.supportedLocales, | |
title: ref.watch(currentStallProvider)?.place?.name ?? '', | |
theme: MainTheme.theme, | |
home: MyHomePage( | |
title: ref.watch(currentStallProvider)?.place?.name ?? '')) |
This file contains 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 'package:flutter/material.dart'; | |
class TimePickerWidget extends StatefulWidget { | |
TimePickerWidget({Key? key, required this.onTimeSelected, required this.label}) : super(key: key); | |
final String label; | |
final Function(TimeOfDay) onTimeSelected; | |
@override |
This file contains 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 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: FadeInDemo(), | |
); |
OlderNewer