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 Foundation | |
import AVFoundation | |
extension AVPlayer { | |
var isPlaying: Bool { | |
if (self.rate != 0 && self.error == nil) { | |
return true | |
} else { | |
return false |
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 | |
/* | |
* Add FCM Class | |
*/ | |
class Google_Service_Fcm extends Google_Service | |
{ | |
/** Set URL for Google Cloud Platform services. */ | |
const CLOUD_PLATFORM = "https://www.googleapis.com/auth/cloud-platform"; | |
const FCM = "https://www.googleapis.com/auth/firebase.messaging"; |
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
# REF: http://www.quora.com/How-do-I-create-and-update-embedded-documents-with-MongoEngine | |
class Comment(EmbeddedDocument): | |
content = StringField() | |
name = StringField(max_length=120) | |
class Post(Document): | |
title = StringField(max_length=120, required=True) | |
author = StringField(required=True) |
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
# Created by .ignore support plugin (hsz.mobi) | |
### Python template | |
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class | |
# C extensions | |
*.so |
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
docker container start <container_name> | |
// access the docker | |
docker exec -u root -it <container_name> /bin/sh | |
//here change ownership of a folder | |
chown -R user_name:group_name <path/of/folder/that/need/to/change/permission> | |
//here change permission of a folder | |
chmod -R 755 /folder/path/that/need/to/change/permission |
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 * as path from 'path'; | |
import * as cdk from '@aws-cdk/core'; | |
import * as ddb from '@aws-cdk/aws-dynamodb'; | |
import * as apiGatewayV2 from '@aws-cdk/aws-apigatewayv2'; | |
import { LambdaProxyIntegration } from '@aws-cdk/aws-apigatewayv2-integrations'; | |
import { NodejsFunction, NodejsFunctionProps } from '@aws-cdk/aws-lambda-nodejs'; | |
import { HttpIntegration, HttpIntegrationType } from '@aws-cdk/aws-apigatewayv2'; | |
import { dirname } from 'path'; | |
const project_root_dir = path.join(dirname(__filename), '../') |