Skip to content

Instantly share code, notes, and snippets.

Sandor DARGO sandordargo

Block or report user

Report or block sandordargo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Result with variant
#include <iostream>
#include <vector>
#include <string>
#include <exception>
#include <numeric>
#include <functional>
#include <tuple>
#include <memory>
#include <variant>
View Result with pointers
#include <iostream>
#include <vector>
#include <string>
#include <exception>
#include <numeric>
#include <functional>
#include <tuple>
#include <memory>
template <class T>
@sandordargo
sandordargo / gitconfig
Last active Jul 1, 2019
git diff & add combined
View gitconfig
[alias]
da = "! addprev() { while true; do \
read -p \"Do you wish to add this file? ([Y]es, [N]o, [P]atch)\" yn ; \
case $yn in \
[Yy]* ) git add $1; break;; \
[Pp]* ) git add -p $1; break;; \
[Nn]* ) exit;; \
* ) echo "Please answer yes, no or patch.";; \
esac \
done } ; \
@sandordargo
sandordargo / find_first_3_elements.py
Created Aug 18, 2017
Get first 3 largest elements of a list (without sorting the whole list)
View find_first_3_elements.py
import random
def get_random_numbers(amount):
random_numbers = random.sample(range(1, 1000), amount)
print([x for x in reversed(sorted(random_numbers))])
return random_numbers
numbers = get_random_numbers(100)
@sandordargo
sandordargo / find_first_n_elements.py
Created Aug 18, 2017
Get first n largest elements of a list
View find_first_n_elements.py
import random
def get_random_numbers(amount):
random_numbers = random.sample(range(1, 1000), amount)
print([x for x in reversed(sorted(random_numbers))])
return random_numbers
def get_n_largest_elements_of_list(a_list, number_of_elements_to_get):
@sandordargo
sandordargo / ghost_in_the_shell
Last active Feb 28, 2017
ghost in the cell bronze top 50
View ghost_in_the_shell
import sys
from collections import defaultdict
# send to multiples from one, if can
# if closest is enemy and three or two, bomb
# zero prod could bomb
class Increase(object):
You can’t perform that action at this time.