Skip to content

Instantly share code, notes, and snippets.

View tc.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:65dbdfe443f1d3db36c2101d1e65e7fc
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cons161004
{
class Program
{
View 2017_03_17
=СУММЕСЛИ(B2:B26;B25;D2:D26)
=СУММЕСЛИМН(D2:D26;B2:B26;B25;A2:A26;A25)
=ЕСЛИ(ЕПУСТО(B2);"";СЧЁТЗ($B$2:B2))
=ИНДЕКС(B2:F10;ПОИСКПОЗ(J2;A2:A10;0);ПОИСКПОЗ(J3;B1:F1;0))
View C# Vec3 struct
struct Vec3
{
public double x, y, z;
public Vec3(double x_, double y_, double z_)
{
x = x_;
y = y_;
z = z_;
}
View Canvas_vec_editod.py
import tkinter
def click_listen1(e):
global lin
#e.widget.create_line(0, 0, e.x, e.y, fill = "#ffff00", width = 4)
#e.widget.coords(lin, *(0, 0, e.x, e.y, e.x -100, e.y - 100))
if(lin):
lin_c.append(e.x)
lin_c.append(e.y)
e.widget.coords(lin, *lin_c)
else:
@Vftdan
Vftdan / Canon_bubbles.py
Last active May 12, 2017
TKinter canvas game
View Canon_bubbles.py
from tkinter import *
from random import *
from time import sleep
#from multiprocessing import Process
DEBUG = True
HEIGHT = 1080 - 27
WIDTH = 1920
BUBBLE_COUNT = 50
g = 9.8
@Vftdan
Vftdan / script.js
Created Jul 2, 2018
Open stackoverflow after error
View script.js
window.onerror = function(msg) {
msg = msg.replace(/^Uncaught /, '');
if(confirm('Search?\n' + msg)) {
window.open('//stackoverflow.com/search?q=' + encodeURIComponent(msg), '_blank');
window.onerror = null;
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am vftdan on github.
  • I am vftdan (https://keybase.io/vftdan) on keybase.
  • I have a public key ASCJfzScL0ociu3eeXCBvi8el-OcEy6352lz03InTpBY1Ao

To claim this, I am signing this object:

@Vftdan
Vftdan / IntxLNK2Junction.py
Last active Oct 13, 2018
Script for windows that converts IntxLNK files to NTFS junctions
View IntxLNK2Junction.py
#! /C/Windows/System32/cmd.exe /s /c python
from subprocess import run, PIPE
from sys import argv, executable
from os.path import realpath
import os
try:
run(['mklink'], shell=True, stdout=PIPE, stderr=PIPE)
except FileNotFoundError:
print('Python seems to be launched not from cmd.exe.\nPress enter to restart in cmd....', end='')
input()
View soap-container.scad
//by Vftdan
module detSphere(radius, details=1) scale(1 / details) sphere(radius * details);
module zcyl(h, r, details) scale(1 / details) cylinder(h * details, r=r * details, center=true);
module xcyl(h, r, details) rotate([0, 90, 0]) zcyl(h, r, details);
module ycyl(h, r, details) rotate([90, 0, 0]) zcyl(h, r, details);
module bottomSmoothedCuboid(width, depth, height, radius, details=1) {
d = radius * 2;
intersection() {
translate([0, 0, height / 2]) {