Skip to content

Instantly share code, notes, and snippets.

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active November 16, 2024 05:10
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@georgexsh
georgexsh / goto.py
Created September 18, 2017 07:47
python goto with system trace function
import sys
def j(lineno):
frame = sys._getframe().f_back
called_from = frame
def hook(frame, event, arg):
if event == 'line' and frame == called_from:
try:
frame.f_lineno = lineno
// Рецепт, как скачать всё состояние биржи WT от https://vk.com/smee_again
// 1. открываем Google Chrome, заходим на ЛЮБУЮ страницу webtransfer (должны быть залогинены)
// 2. заходим в Меню -> Просмотр -> Разработчикам -> Консоль Javascript
// 3. вставляем сюда ВСЁ вот это, жмём ENTER, и ждём несколько секунд:
var PERPAGE=100500,
//WT_URL = 'https://webtransfer-finance.com/ru/account/ajax_user/applications_table/1/', // «Дать кредит»
WT_URL = 'https://webtransfer-finance.com/ru/account/ajax_user/applications_table/2/', // «Получить кредит»
CSV_SEPARATOR=';'; // если в Excel криво отображается табличка, то заменить на «,»
$.post(WT_URL, {"per_page": PERPAGE, "offset": 0, "search": "", "filter": "", "order[id]": "desc"}, function(r) {
var csvContent = [ // это названия столбцов в файле. Можно переименовывать по вкусу:
@Chaser324
Chaser324 / GitHub-Forking.md
Last active November 14, 2024 08:32
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@smoser
smoser / ubuntu-cloud-virtualbox.sh
Last active July 5, 2024 09:33
example of using Ubuntu cloud images with virtualbox
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"