In project root directory the create a folder called '.github'
Create a file in the format workflows/django.yml
package org.dailyislam.android.utilities | |
import android.content.Context | |
import android.net.ConnectivityManager | |
import android.net.NetworkInfo | |
import android.telephony.TelephonyManager | |
import java.net.InetAddress | |
class ConnectivityUtil(private val applicationContext: Context) { |
import json, hmac, hashlib, time, requests | |
import numpy as np | |
from requests.auth import AuthBase | |
import matplotlib.pyplot as plt | |
# Name of account holder (only for displaying) | |
USER = 'My name' | |
# API key and secret. Create these in your Coinbase account with all read permissions selected for all accounts | |
API_KEY = 'xxx' |
/** | |
depends on config from https://www.baeldung.com/java-bouncy-castle | |
*/ | |
import org.bouncycastle.cms.* | |
import org.bouncycastle.cms.jcajce.JceCMSContentEncryptorBuilder | |
import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient | |
import org.bouncycastle.cms.jcajce.JceKeyTransRecipientInfoGenerator | |
import org.bouncycastle.jce.provider.BouncyCastleProvider | |
import org.bouncycastle.util.encoders.Base64 |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
/* | |
* Copyright 2017 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | |
* except in compliance with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under the | |
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
# The initial version | |
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi | |
# My favorite from the comments. Thanks @richarddewit & others! | |
set -a && source .env && set +a |
<template> | |
<el-menu :router="true" :default-active="activeLink"> | |
<template v-for="rule in $router.options.routes"> | |
<el-submenu v-if="rule.children && rule.children.length > 0" | |
:index="rule.path" | |
> | |
<template slot="title"><i :class="rule.icon"></i>{{ rule.title }}</template> | |
<el-menu-item v-for="child in rule.children" :index="rule.path + '/' + child.path">{{ child.title }}</el-menu-item> | |
</el-submenu> | |
<el-menu-item v-else |
var request = require('request-promise'); | |
var crypto = require('crypto'); | |
var config = {...}; | |
function getAccessToken(cookies) { | |
var cookieName = 'fbsr_' + config.client_id; | |
var signedRequest = cookies[cookieName]; | |
var code = getCode(signedRequest); | |
return exchangeCodeForAccessToken(code); | |
}; |
def nearby_spots_old(request, lat, lng, radius=5000, limit=50): | |
""" | |
WITHOUT use of any external library, using raw MySQL and Haversine Formula | |
http://en.wikipedia.org/wiki/Haversine_formula | |
""" | |
radius = float(radius) / 1000.0 | |
query = """SELECT id, (6367*acos(cos(radians(%2f)) | |
*cos(radians(latitude))*cos(radians(longitude)-radians(%2f)) | |
+sin(radians(%2f))*sin(radians(latitude)))) |