Skip to content

Instantly share code, notes, and snippets.

View mraza007's full-sized avatar
:shipit:
Hi :)

Muhammad mraza007

:shipit:
Hi :)
View GitHub Profile
#include<iostream>
using namespace std;
int main(){
for(int i=0; i<1000000; i++){
cout << i*i << endl;
}
}
#include <stdio.h>
int main()
{
int num;
int squares;
int count;
// for loop terminates when n is less than count
for(count = 0; count < 1000000; count++)
{
use std::env;
use std::fs;
fn main() {
// --snip--
println!("In file {}", "Hello.txt");
let contents = fs::read_to_string("Hello.txt")
.expect("Something went wrong reading the file");
#include <stdio.h>
#include <stdlib.h>
int main(){
FILE *fPointer;
fPointer = fopen("Hello.txt","r");
char singleLine[150];
while(!feof(fPointer)){
fgets(singleLine,150,fPointer);
puts(singleLine);
@mraza007
mraza007 / pgsql.md
Last active September 26, 2018 19:05
Postgres Useful Commands

Postgres useful commands

  • psql db_name Connecting to Database
  • \df+ View tables
  • \du View users
  • \q: Quit/Exit
  • \c __database__: Connect to a database
  • \d __table__: Show table definition including triggers
  • \l: List databases
  • \dy: List events
  • \df: List functions
@mraza007
mraza007 / commands.md
Created September 26, 2018 17:46
This gist will contain all the postgres commands that I use on daily basis.

Postgres Useful Commands

@mraza007
mraza007 / A simple graph
Created July 23, 2018 22:03
This is a simple graph that use TeX pgfplots package
\documentclass[]{standalone}
\usepackage{xcolor}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[ytick={0,1,2,3,4,5,6,7,8,9,10},yticklabels={$0$,$1$,$2$,$3$,$4$,$5$,$6$,$7$,$8$,$9$,$10$},ylabel={$KWH$}, xtick={0,1,2,3,4,5,6,7,8,9,10},xticklabels={$0$,$1$,$2$,$3$,$4$,$5$,$6$,$7$,$8$,$9$,$10$},xlabel={$Timer$}]
\addplot[smooth, mark=*] coordinates {(0,0)
(1,6)
(1.5,6)
(2,3)