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
FROM ubuntu:18.10 | |
# non interactive frontend for locales | |
ENV DEBIAN_FRONTEND=noninteractive | |
# installing texlive and utils | |
RUN apt-get update && \ | |
apt-get -y install --no-install-recommends pandoc texlive texlive-latex-extra texlive-generic-extra texlive-extra-utils texlive-fonts-extra texlive-bibtex-extra biber latexmk make git procps locales curl && \ | |
rm -rf /var/lib/apt/lists/* |
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
########## Install NGINX ############## | |
# Install software-properties-common package to give us add-apt-repository package | |
sudo apt-get install -y software-properties-common | |
# Install latest nginx version from community maintained ppa | |
sudo add-apt-repository ppa:nginx/stable | |
# Update packages after adding ppa |
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
package in.co.shuklarahul.sotest; | |
import android.animation.ValueAnimator; | |
import android.content.Context; | |
import android.support.design.widget.AppBarLayout; | |
import android.support.design.widget.CoordinatorLayout; | |
import android.support.v4.view.ViewCompat; | |
import android.util.AttributeSet; | |
import android.view.View; |
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 static String decrypt(@NotNull String input, @NotNull String key){ | |
byte[] bytes = Base64.decodeBase64(input); | |
if(bytes.length < 17) { | |
return null; | |
} | |
byte[] ivBytes = Arrays.copyOfRange(bytes, 0, 16); | |
byte[] contentBytes = Arrays.copyOfRange(bytes, 16, bytes.length); | |
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
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success ๐ | |
console.log(response); | |
} catch (error) { | |
// Error ๐จ |
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
final NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) | |
.setContentTitle(context.getString(R.string.app_name)) | |
.setSmallIcon(R.mipmap.ic_launcher) | |
.setContentText("notification with image") | |
.setContentIntent(resultPendingIntent) | |
.setPriority(Notification.PRIORITY_DEFAULT) | |
.setAutoCancel(true) | |
.setGroup(context.getString(R.string.app_name)) | |
.setDefaults(defaults); |
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 zipfile | |
from surprise import Reader, Dataset, SVD, evaluate | |
# Unzip ml-100k.zip | |
zipfile = zipfile.ZipFile('ml-100k.zip', 'r') | |
zipfile.extractall() | |
zipfile.close() | |
# Read data into an array of strings | |
with open('./ml-100k/u.data') as f: |
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
<div class="image-wrap"> | |
<img src="https://unsplash.it/900/700"> | |
</div> |
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 | |
#API access key from Google API's Console | |
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' ); | |
$registrationIds = $_GET['id']; | |
#prep the bundle | |
$msg = array | |
( | |
'body' => 'Body Of Notification', |
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 android.support.design.widget.AppBarLayout; | |
/** | |
* App bar collapsing state | |
* @author Paulo Caldeira <[email protected]>. | |
*/ | |
public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener { | |
// State | |
public enum State { | |
EXPANDED, |
NewerOlder