Skip to content

Instantly share code, notes, and snippets.


Azat Mardan azat-co

View GitHub Profile
azat-co /
Last active Jun 24, 2020
The list of most commonly used jQuery API functions

Here is the list of most commonly used jQuery API functions:

  • find(): Selects elements based on the provided selector string
  • hide(): Hides an element if it was visible
  • show(): Shows an element if it was hidden
  • html(): Gets or sets an inner HTML of an element
  • append() Injects an element into the DOM after the selected element
  • prepend() Injects an element into the DOM before the selected element
  • on(): Attaches an event listener to an element
  • off() Detaches an event listener from an element
azat-co /
Last active Feb 7, 2020
JavaScript FUNdamentals

JS FUNdamentals

If it's not fun, it's not JavaScript.


Programming languages like BASIC, Python, C has boring machine-like nature which requires developers to write extra code that's not directly related to the solution itself. Think about line numbers in BASIC or interfaces, classes and patterns in Java.

On the other hand JavaScript inherits the best traits of pure mathematics, LISP, C# which lead to a great deal of expressiveness (and fun!).

View kaiser-class-class.js
// const Animal = function() {
// this.speed = 0
// return {
// run: function() {
// this.speed += 10
// console.log(this.speed)
// }
// }
// }
azat-co / express.js
Last active Aug 19, 2018
Tutorial: REST API with Node.js and MongoDB using Mongoskin and Express.js
View express.js
var express = require('express')
, mongoskin = require('mongoskin')
var app = express()
var db = mongoskin.db('localhost:27017/test', {safe:true});
app.param('collectionName', function(req, res, next, collectionName){
req.collection = db.collection(collectionName)
azat-co / file-structure
Created Jun 6, 2013
Instagram Gallery: A demo app build with Storify API and Node.js
View file-structure
- index.js
- package.json
- public/js/main.js
- public/index.html
- css/bootstrap-responsive.min.css
- css/flatly-bootstrap.min.css
View rest-crud.js
const express = require('express')
const logger = require('morgan')
let app = express()
const mongodb= require('mongodb')
const url = 'mongodb://localhost:27017/mean'
const bodyParser = require('body-parser')
mongodb.MongoClient.connect(url, (error, db)=>{
if (error) return process.exit(1)
View timer-simple.jsx
const ReactDOM = require('react-dom')
const React = require('react')
const TimerButton = (props) => {
return (
<button type="button" onClick={()=>{
}}>Start {props.time}</button>
const TimerLabel = (props) => {
View slow-hello-world.js
const port = 80
.createServer((req, res) => {
console.log('url:', req.url)
console.log('now we will slow down and block and consume CPU...')
for (var i=0; i< 100000000; i++) {}
res.end('hello world')
.listen(port, (error)=>{
console.log(`server is running on ${port}`)
You can’t perform that action at this time.