This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# how to use | |
# | |
# |----------------------- $1 - filename; can be _ | |
# | |------------------ $2 - window coordinate x | |
# | | |---------------- $3 - window coordinate y | |
# | | | |------------ $4 - width | |
# | | | | |------- $5 - height | |
# | | | | | |--- $6 - display number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Draw a spiral matrix. | |
[ 1, 2, 3, 4] | |
[12, 13, 14, 5] | |
[11, 16, 15, 6] | |
[10, 9, 8, 7] | |
1. Initialize the multidimensional array. | |
2. Create counter variables to track positions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function print(o){ | |
var | |
m = o.length >> 1, | |
r = m, | |
c = m + 1; | |
p = function(){ | |
console.log(o[r][c]); | |
}, | |
left = function(i){ | |
for(; c > i; p(--c)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head><title>SOUND</title></head> | |
<body> | |
<div>Frequence: <span id="frequency"></span></div> | |
<script type="text/javascript"> | |
var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); | |
var oscillatorNode = audioCtx.createOscillator(); | |
var gainNode = audioCtx.createGain(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem author https://github.com/shpaker | |
@echo off | |
:main | |
echo [1] Start Wi-Fi network | |
echo [2] Stop Wi-Fi network | |
echo [3] Restart Wi-Fi network | |
echo [4] Config Wi-Fi network (require administrator privileges) | |
echo [0] Exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
you.js - "You Are an Idiot" script | |
The Commentary | |
*/ | |
// bookmark - adds IE favorite, reminding you that you're an idiot | |
function bookmark(){ | |
if ( (navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4) ){ | |
var url="http://offiz.bei.t-online.de/idiot.html"; | |
var title="Idiot!"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Функция, выводящая числовые спирали. | |
Например: | |
1 2 3 4 5 | |
18 19 20 21 6 | |
17 28 29 22 7 | |
16 27 30 23 8 | |
15 26 25 24 9 | |
14 13 12 11 10 | |
Входные данные: ширина и высота спирали. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spiralize = function(size) { | |
let spiral = []; | |
for(let i=0;i<size;i++) { | |
spiral[i] = Array(size).fill(0); | |
} | |
let min = 0; | |
let max = size; | |
while (min < max ) { | |
for(let i=min;i<max;i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Perlin noise implementation.""" | |
# Licensed under ISC | |
from itertools import product | |
import math | |
import random | |
def smoothstep(t): | |
"""Smooth curve with a zero derivative at 0 and 1, making it useful for | |
interpolating. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from PyQt5.QtWidgets import (QWidget, QDataWidgetMapper, | |
QLineEdit, QApplication, QGridLayout, QListView) | |
from PyQt5.QtCore import Qt, QAbstractTableModel, QModelIndex | |
class Window(QWidget): | |
def __init__(self, parent=None): |
NewerOlder