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 / gist:5fac8b4c1d2f66108181709032f0a49e
Created August 6, 2018 12:36 — forked from fuzzmz/gist:4111521
git revert to specific commit
git reset 56e05fced #resets index to former commit; replace '56e05fced' with your commit code
git reset --soft HEAD@{1} #moves pointer back to previous HEAD
git commit -m "Revert to 56e05fced"
git reset --hard #updates working copy to reflect the new commit
@moiz-frost
moiz-frost / tmux-cheats.md
Created March 26, 2018 14:09 — forked from Starefossen/tmux-cheats.md
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@moiz-frost
moiz-frost / Advanced Bash Usage CheatSheet.md
Created March 24, 2018 09:22 — forked from projectivemotion/Advanced Bash Usage CheatSheet.md
Cheatsheet of advanced bash commands presented in Introduction to Advanced Bash Usage - James Pannacciulli. Youtube: https://youtu.be/uqHjc7hlqd0
@moiz-frost
moiz-frost / exchange_seeder.js
Created March 7, 2018 19:48
exchange_seeder.js
var mongoose = require('mongoose')
var Schema = mongoose.Schema
mongoose.Promise = global.Promise
mongoose.connect(process.env.MONGO_URL || 'mongodb://localhost:27017/woxcut')
var db = mongoose.connection
db.on('error', console.error.bind(console, 'Connection Error:'))
@moiz-frost
moiz-frost / jupyter_shortcuts.md
Created November 24, 2017 07:07 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
var async = require('async');
var parallel = require('async/parallel');
function giveData() {
var data;
async.parallel([
function(callback){
callback(null, 'one');
},
function(callback){
@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?
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
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
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>]