Skip to content

Instantly share code, notes, and snippets.

View moiz-frost's full-sized avatar
🧠

Abdul Moiz Sheikh moiz-frost

🧠
View GitHub Profile
@moiz-frost
moiz-frost / pthread.c
Created April 20, 2017 19:54
Addition of numbers using threads
// Run 'gcc -pthread pthread.c -o exec' to compile
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#define LINE_READ_SIZE 100
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
void error(char *msg)
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
void error(char *msg)
// Run 'gcc -pthread pthread.c -o exec' to compile
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#define LINE_READ_SIZE 100
@moiz-frost
moiz-frost / Nightmare
Created July 25, 2017 19:11
Nightmare
var $ = require('jquery');
var Nightmare = require('nightmare');
var nightmare = Nightmare(
{
show: true
});
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap 3.0 Grid System</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style>
body{
SQL*Plus: Release 12.1.0.1.0 Production on Wed Sep 21 12:15:12 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter user-name: / as sysadmin
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
<proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
unlock HR, Scott etc. users in Oracle Database 12c.
Step 1:
C:\> sqlplus / as sysdba
SQL> SHOW con_name
SQL> SELECT name, con_id FROM v$pdbs;
SQL> SELECT name FROM v$active_services WHERE con_id = 3;
Step 2: Update tnsname.ora file
var app = require('koa')()
, logger = require('koa-logger')
, json = require('koa-json')
, views = require('koa-views')
, onerror = require('koa-onerror')
, session = require('koa-session');
var mongoose = require(__dirname + '/database/connection');
// all routes - TODO
@moiz-frost
moiz-frost / gist:91e288bbce1f86a8a3e37c09a93f2733
Created November 5, 2017 16:58
​ What you need to know about node first
What is the relationship between Node.js and V8? Can Node work without V8?
How come when you declare a global variable in any Node.js file it’s not really global to all modules?
When exporting the API of a Node module, why can we sometimes use exports and other times we have to use module.exports?
Can we require local files without using relative paths?
Can different versions of the same package be used in the same application?
What is the Event Loop? Is it part of V8?
What is the Call Stack? Is it part of V8?
What is the difference between setImmediate and process.nextTick?
How do you make an asynchronous function return a value?
Can callbacks be used with promises or is it one way or the other?