Skip to content

Instantly share code, notes, and snippets.

View joynal's full-sized avatar
🏠
Working from home

Joynal Abedin joynal

🏠
Working from home
View GitHub Profile
@joynal
joynal / List.md
Last active August 29, 2015 14:25 — forked from msurguy/List.md

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@joynal
joynal / AuthController.php
Created February 28, 2016 17:14
Multiuser login system
<?php
namespace App\Http\Controllers\Auth;
use Auth;
use Redirect;
use Validator;
use App\Models\User;
use App\Models\Role;
use App\Models\Level;
@joynal
joynal / index.htm
Created March 3, 2016 11:10
Adding numbers, multiple times
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Html Calculator</title>
</head>
<body>
<div id="output"></div>
<div>
<label for="num_1">First Input</label>
@joynal
joynal / server-setup.sh
Last active September 22, 2016 04:05
Ubuntu server setup automation. [compatible with 14.4]
#!/bin/sh
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
if [ -z "$1" ]
then
echo "Usage: $0 user_name"
class Person{
@observable firstName = 'David';
@observable lastName = 'Khan';
@observable age = 23;
@computed fullName(){
return firstName + ' ' + lastName;
}
@action changeName(firstName, lastName){
<?php
// Normal array, can be accessed with indices.
$data[] = ['apple', 'orrange', ['banana', 'Papayas', ['Potato', 'Tomato']]];
echo $data[0][0]; // 'apple'
echo $data[0][2][0]; // 'banana'
echo $data[0][2][2][1]; // 'Tomato'
//Associative array, can be accessed with key.
'use strict';
const bcrypt = require('bcrypt');
const crypto = require('crypto');
function createNewUser(db, data){
let user = db.createUser({
name: data.name,
email: data.email,
password: makeHash(data.password),
@joynal
joynal / Profile.js
Last active November 13, 2016 09:58
Veu profile component
<template>
<div class="container-fluid">
<div class="row">
<div v-if="loading">Loading...</div>
<notification v-if="info" :info="info" :flag="requestSuccess"></notification>
<div v-if="requestSuccess" class="col-lg-6">
<h2>Profile settings</h2>
<ul v-if="!editMode" class="list-group">
<li class="list-group-item list-group-item-action">Name: {{name}}</li>
@joynal
joynal / my-sublime-text-settings.json
Last active December 27, 2016 10:00
Sublime text settings with material theme
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"font_face": "Operator mono book",
"font_options":
[
"no_round"
],
"font_size": 11,
@joynal
joynal / test.sql
Last active December 29, 2016 08:06
SELECT
a2, b2, c2
FROM
A
INNER JOIN
B ON B.a_id = A.id AND B.b1 = "Y"
INNER JOIN
C ON C.b_id = B.id AND C.c1 = "Z"
WHERE A.a1 = 'X';