Skip to content

Instantly share code, notes, and snippets.

View dnamsons's full-sized avatar

Dāvis Namsons dnamsons

  • TradeLink
  • Riga, Latvia
  • 04:28 (UTC +03:00)
View GitHub Profile
@dnamsons
dnamsons / B1.cpp
Last active October 3, 2018 08:14
Rencis_KD1
#include <iostream>
using namespace std;
int main() {
string ievade;
cin >> ievade;
int length = ievade.length();
if(length <= 100) {
for(int i = 0; i < length; i++) {
@dnamsons
dnamsons / launch.json
Created September 28, 2018 08:51
Debug files in VS Code
{
"name": "Debug Current File",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${file}",
"env": {
"pathToRDebugIDE": "/Users/namsodav/.rvm/gems/ruby-2.4.4/bin/rdebug-ide"
}
},
@dnamsons
dnamsons / bash_profile.sh
Last active September 18, 2018 07:07
bash profile
function prompt_rvm {
rbv=`rvm-prompt`
echo [$rbv]
}
function parse_git_branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# user in blue@directory name in green[ruby version in red](current git branch in brown)
@dnamsons
dnamsons / Extension List.txt
Last active September 18, 2018 07:05
My vscode settings
General
vscode-icons
Code Runner
Live Server
TODO Highlight
Pomodoro Timer
Dash
Gitlens
vscode-pdf(?)
Wakatime(?)
class Spiral
attr_accessor :array, :result, :upper_limit, :bottom_limit, :right_limit, :left_limit
def initialize(array)
@array = array
end
def order
@upper_limit = 0
@bottom_limit = @array.length - 1

Keybase proof

I hereby claim:

  • I am dnamsons on github.
  • I am dnamsons (https://keybase.io/dnamsons) on keybase.
  • I have a public key ASC8nDOONn7dqE_KV1-XWC4XiVvmQeCYlmqT0fDBQZoQ6Ao

To claim this, I am signing this object:

@dnamsons
dnamsons / G_b.cpp
Last active June 24, 2018 20:58
G ar std::list
#include <iostream>
#include <list>
using namespace std;
//Funkcija pārvieto pieprasīto elementu uz saraksta beigām
void do_move(list<int> &l, int n)
{
list<int>::iterator iter = l.begin();
for (int index = 0; index != n; ++iter, index++)
#include <iostream>
using namespace std;
/*
====================================================================
Dāvis Namsons stud. apl. nr. - dn17005
====================================================================
G6. Uzrakstīt funkciju, kas no diviem sarakstiem izveido trešo tā,
lai 3. sarakstā būtu visas vērtības no 1. un 2. saraksta
un izveidotajā sarakstā nebūtu elementu ar vienādām vērtībām.
@dnamsons
dnamsons / CD
Last active April 1, 2018 14:38
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
fstream fin;
fstream fout;
fin.open("cd.in",fstream::in);