Skip to content

Instantly share code, notes, and snippets.

View AshikNesin's full-sized avatar

Ashik Nesin AshikNesin

View GitHub Profile
@AshikNesin
AshikNesin / jquery-form-submit.js
Last active February 22, 2017 07:14
[jQuery] Ajax form Submit
$(document).ready(function() {
$.validate();
// Object as Array
$.fn.serializeObject = function() {
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
@AshikNesin
AshikNesin / node-ubuntu.sh
Created February 8, 2017 14:20
Node Ubuntu
wget -qO- https://deb.nodesource.com/setup_7.x | sudo bash -
sudo apt-get install -y nodejs
a2enmod rewrite
@AshikNesin
AshikNesin / auto-depoy.sh
Created February 7, 2017 01:29
Auto Deployment using BitBucket Pipelines
# Test it in docker
docker run -it --volume=/Users/AshikNesin/Code/sandbox/auto-deploy-pipelines:/auto-deploy-pipelines --workdir="/auto-deploy-pipelines" --memory=4g --entrypoint=/bin/bash node:7.0.0
@AshikNesin
AshikNesin / react-file-upload.js
Created February 2, 2017 06:46
Simple React File Upload
import React from 'react'
import axios, { post } from 'axios';
class SimpleReactFileUpload extends React.Component {
constructor(props) {
super(props);
this.state ={
file:null
}
@AshikNesin
AshikNesin / array-filter-map.js
Created February 1, 2017 07:03
Insert/Update Items - Filter & Map Array
let jobs = [{id:44,selected:false},{id:12,selected:true}]
const handleChange = (item) =>{
let existItemIndex;
jobs.map((job,index)=>{
(job.id === item.id) && (existItemIndex = index)
})
if(!existItemIndex){
jobs = jobs.concat(item)
}

Direct Messaging

Hello there, good folks! Today I created direct messaging screen with bubbles, nice smooth animation, and some cool dynamics, with pure css3 and html5 with almost no jQuery. How do you like it? :)

A Pen by Momcilo Popov on CodePen.

License.

@AshikNesin
AshikNesin / airtable-proxy.js
Created December 25, 2016 11:45 — forked from benoror/airtable-proxy.js
Node.js Airtable API Proxy
var express = require('express');
var proxy = require('http-proxy-middleware');
var options = {
logLevel: 'debug',
target: 'https://api.airtable.com/v0/' + process.env.APP_ID,
changeOrigin: true,
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer ' + process.env.API_KEY
},
@AshikNesin
AshikNesin / setup-lamp-ubuntu.sh
Last active April 2, 2019 03:01
Setup LAMP Stack Ubuntu 16
# Install Apache
sudo apt-get update
sudo apt-get install apache2 -y
# Install PHP7
sudo apt-get -y install php7.0 libapache2-mod-php7.0
sudo apt-get install php7.0-cli php7.0-common libapache2-mod-php7.0 php7.0 php7.0-mysql php7.0-fpm -y
# Other packages which might be useful
@AshikNesin
AshikNesin / statuses.md
Created December 4, 2016 11:26 — forked from vkostyukov/statuses.md
HTTP status codes used by world-famous APIs
API Status Codes
[Twitter][tw] 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504
[Stripe][stripe] 200, 400, 401, 402, 404, 429, 500, 502, 503, 504
[Github][gh] 200, 400, 422, 301, 302, 304, 307, 401, 403
[Pagerduty][pd] 200, 201, 204, 400, 401, 403, 404, 408, 500
[NewRelic Plugins][nr] 200, 400, 403, 404, 405, 413, 500, 502, 503, 503
[Etsy][etsy] 200, 201, 400, 403, 404, 500, 503
[Dropbox][db] 200, 400, 401, 403, 404, 405, 429, 503, 507
@AshikNesin
AshikNesin / simple-counter.js
Last active November 13, 2016 07:40
Very simple counter using React + Redux
const counter = (state=0,action) => {
switch(action.type){
case 'INCREMENT':
return state+1;
case 'DECREMENT':
return state -1;
default:
return state;
}
}