Skip to content

Instantly share code, notes, and snippets.

View arshad115's full-sized avatar
๐Ÿ‹๏ธโ€โ™‚๏ธ
Working on my Android app and a PWA in Vue.js

Arshad Mehmood arshad115

๐Ÿ‹๏ธโ€โ™‚๏ธ
Working on my Android app and a PWA in Vue.js
View GitHub Profile
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/*
@GhazanfarMir
GhazanfarMir / Instructions.sh
Last active December 22, 2024 01:12
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## 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
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;
@Haehnchen
Haehnchen / decrypt.java
Created May 14, 2017 15:43
PHP encrypt and JAVA decrypt with openssl and AES-128-CBC
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);
@fgilio
fgilio / axios-catch-error.js
Last active February 27, 2025 05:50
Catch request errors with Axios
/*
* 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 ๐Ÿ˜จ
@JChudasama
JChudasama / ImageNotificationSample.java
Last active November 11, 2024 01:10
Android Image Notification Sample from URL (using Picasso) - Big Picture Style
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);
@mahermalaeb
mahermalaeb / surprise_tutorial.py
Last active November 21, 2019 02:03
The easy guide for building python collaborative filtering recommendation system inย 2017
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:
@CodeMyUI
CodeMyUI / index.html
Created January 30, 2017 00:43
Ken Burns effect - pure css
<div class="image-wrap">
<img src="https://unsplash.it/900/700">
</div>
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active December 28, 2024 22:56
This repository showcases a simple and effective script to send push notifications to Android devices using Firebase Cloud Messaging (FCM). Designed for developers, the code provides a quick setup for integrating FCM notifications with minimal configuration.
<?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',
@paulocaldeira17
paulocaldeira17 / AppBarStateChangeListener.java
Last active August 22, 2024 06:23
Android AppBarLayout collapsed/expanded state listener
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,