Skip to content

Instantly share code, notes, and snippets.

@hoanvuso
hoanvuso / blockchain
Created October 26, 2018 01:44
block chain
Skip to content
Features
Business
Explore
Marketplace
Pricing
Search
Sign in or Sign up
@hoanvuso
hoanvuso / CSS
Created February 23, 2018 14:56
CSS
@charset "UTF-8";
.clearfix::after {
content: "";
clear: both;
display: table;
}
.text-red {
color: #ff0000;
font-weight: bold;
public function privateChat($modelId, Request $req) {
//TODO - setup ACL instead
$loginData = AppSession::getLoginData();
if (!$loginData) {
//restrict for mdoel only
return redirect('/login');
}
$model = User::where('id', '=', $modelId)->where('role', '=', 'model')->first();
angular.module('perfecticeApp').controller('StudentProfileUpdateCtrl', function(grades, $scope, countryService, $rootScope, authService,
$cookieStore, FileUploader, countries, $document) {
var user = authService.getCurrentUser();
$scope.error = {};
$scope.countries = countries;
$scope.user = angular.copy(user);
$scope.grades = grades;
$scope.maxDate = new Date();
$scope.formatDate = 'dd-MM-yyyy';
if (!$scope.user.country || !$scope.user.country.code || !$scope.user.country.name) {
<?php
namespace App;
use EloquentFilter\Filterable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\App;
use League\Flysystem\Exception;
use App\Category;
@hoanvuso
hoanvuso / gist:0a3fdcf8fec091c30a06e163b67b04f0
Created October 11, 2016 07:49
Oauth2 with Google in Node.js
import passport from 'passport';
import {Strategy as LocalStrategy} from 'passport-local';
function localAuthenticate(User, email, password, done) {
User.findOne({
email: email.toLowerCase()
}).exec()
.then(user => {
if (!user) {
return done(null, false, {
https://bitbucket.org/rajeev_93225/perfectice-mobile/src/1bdebba70ed5b5a8598d5e4e580f366f1e61411c/mobileApp/www/layout/menu.html?at=master&fileviewer=file-view-default
<ion-side-menus enable-menu-with-back-views="false">
<ion-side-menu-content>
<ion-nav-bar ng-class="{expanded: isExpanded, 'has-header-fab-left': hasHeaderFabLeft, 'has-header-fab-right': hasHeaderFabRight ,'bar-transparent':isTransparentBar }" align-title="left">
<ion-nav-back-button class="no-text">
</ion-nav-back-button>
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
@hoanvuso
hoanvuso / React Native
Created October 5, 2016 06:37
React Native code
https://bitbucket.org/hoanvusolutions/rator-ios-react-native/src/d9e651e3c3beb72e10a954e9c612248a946e8418/js/components/message/MessageListComponent.js?at=master&fileviewer=file-view-default
import {
React, _, Icon, StoreComponent, SocketIO, Utils,
View, TextInput, StyleSheet, ListView, TouchableOpacity, Text,
ActivityIndicatorIOS, InvertibleScrollView, HTMLView, moment, Image
} from '../../lib';
import { MessageService, UserService } from '../../services';
import { GroupStore, UserStore } from '../../stores';
import { GroupActions } from '../../actions';
@hoanvuso
hoanvuso / Angular Material
Created August 9, 2016 09:53
Angular Material
var toast = $mdToast.simple()
.textContent('Payment discarded')
.action('UNDO')
.highlightAction(false)
.position("right bottom");
$mdToast.show(toast).then(function(response) {
if (response != 'ok') {
PaymentService.discardPayment(record.transactionId, null, null, function(resp){
if (resp.success) {
if (resp.code != 200) {
/**
* register new dealer account
*/
exports.register = (req, res) => {
co(function* () {
let errors = validator.validateRegister(req);
if (errors) {
throw { status: 422, body: errors };
}