Skip to content

Instantly share code, notes, and snippets.

View arukavina's full-sized avatar

Andrei Rukavina arukavina

View GitHub Profile
@arukavina
arukavina / friends.py
Last active May 28, 2018 14:17
How to make friends
amigos = set()
contacts = dict(adri=['thijn', 'jonas'],
flor=['random1', 'random2'],
gerard=['random1', 'random2'],
rami=['random1', 'random2'],
agustin=['random1', 'random2'],
andrei=['robertito el de c5n', 'random2'],
)
for member in contacts.keys():
print('{} sharing {} contacts'.format(member, len(contacts[member])))
@arukavina
arukavina / CHANGELOG.md
Created April 14, 2018 18:55
CHANGELOG.md example

Changelog

All notable changes to this project will be documented in this file.

[Unreleased]

[0.0.3] — 2014–08–09

Added

  • “Why should I care?” section mentioning The Changelog podcast.

[0.0.2] — 2014–07–10

@arukavina
arukavina / python_comments.py
Created April 14, 2018 18:53
Python Inner Comments
g = 'module attribute (module-global variable)'
"""This is g's docstring."""
class AClass:
c = 'class attribute'
"""This is AClass.c's docstring."""
def __init__(self):
"""Method __init__'s docstring."""
@arukavina
arukavina / header_examples.py
Created April 14, 2018 18:40
Python header shebang examples
#!/usr/bin/python
# -*- coding: latin-1 -*-
import os
#!/usr/bin/python
# -*- coding: iso-8859–15 -*-
import os
@arukavina
arukavina / header1b.py
Created April 14, 2018 18:37
Python Header Imports
# Futures
from __future__ import unicode_literals
from __future__ import print_function
# Generic/Built-in
import datetime
import argparse
# Other Libs
import youtube_dl
@arukavina
arukavina / header1.R
Created April 14, 2018 18:34
Lazy C&P R template
#!interpreter {optional-arg}
readRenviron(“/etc/default/locale”)
LANG <- Sys.getenv(“LANG”)
if(nchar(LANG))
 Sys.setlocale(“LC_ALL”, LANG)
 
##################################################
@arukavina
arukavina / header1.py
Last active June 28, 2024 20:30
Lazy C&P header
#!interpreter [optional-arg]
# -*- coding: utf-8 -*-
"""
{Description}
{License_info}
"""
# Futures
from __future__ import print_function