Skip to content

Instantly share code, notes, and snippets.

View anghene's full-sized avatar
🎯
Focusing

AVA anghene

🎯
Focusing
View GitHub Profile
@anghene
anghene / lab5ex1
Created October 28, 2013 19:15
Citeste si scrie (cu echo) un caracter pe ecran.
.model small
.stack
.data
message db "apasati o tasta: ", "$"
message2 db "ati tastat: ", "$"
.code
main proc
mov ax,seg message
mov ds, ax
#include‬ <cstdlib>
#include <iostream>
using namespace std;
void prim(int n)
{
int i;
i=2;
while(n%i!=0&&i*2<=n) i++;
if (2*i<n) printf(" Numar neprim \n");
else
# include <stdio.h>
# include <math.h>
void grad (float a,float b,char *c,float *d)
{
if ((a==0)&&(b==0)) *c='r';
else if (a==0) *c='v';
else if (b==0) *d=0;
else *d=-b/a;
}
int main ()
@anghene
anghene / gist:7412868
Last active December 28, 2015 00:19
Enuntul problemei: Sa se citeasca de la tastatura o tasta, si in functie de ce tasta e, sa afiseze un mesaj distinct (daca e 0 - sa afiseze ca e 0, daca e 1, idem; dar daca e orice alta tasta sa mai ceara o data introducerea unei taste si sa repete procedura).
.model small
.stack
.data
m0 db 10, "ati apasat 0", "$"
m1 db 10, "ati apasat 1", "$"
mgeneral db 10, "nu ati apasat nici 0 nici 1, mai incercati o data", "$"
.code
main proc
citire:
@anghene
anghene / stackop1.asm
Last active January 2, 2016 11:19
Cititi un numar de la tastatura si salvati pe rand cifrele lui in stiva. Redati apoi numarul cand se apasa tasta enter.
.model small
.stack
.data
nr1 dw ?
nr2 dw ?
nr3 dw ?
.code
main proc
mov cx,0
citire:
#include <cstdlib.h>
#include <iostream.h>
#include <malloc.h>
using namespace std;
typedef struct nod{
int cheie;
int valoare;
struct nod*st;
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@anghene
anghene / destructuring.md
Created January 19, 2018 11:00 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@anghene
anghene / vimdiff.md
Last active January 30, 2018 13:05 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@anghene
anghene / useful docker mysql.md
Last active January 28, 2019 12:34
useful docker cmds

Setup a local mysql db

Get a mariaDB container in docker

docker run --name db -e MYSQL_ROOT_PASSWORD=[your password here] -p 3306:3306 --restart=always -d mariadb:latest

Get mysql cli for terminal###

sudo dnf install mysql-community
mysql -host=172.17.0.1 -uroot -p