Skip to content

Instantly share code, notes, and snippets.

View pointofpresence's full-sized avatar
🏠
Working from home

ReSampled pointofpresence

🏠
Working from home
View GitHub Profile
@pointofpresence
pointofpresence / README.md
Created March 30, 2021 05:14 — forked from nitaku/README.md
Three.js isometric SVG

An example showing an isometric rendering in SVG, thanks to three.js.

The example is inspired by this post on using three.js to generate illustrations for scientific papers.

@pointofpresence
pointofpresence / index.php
Last active May 26, 2021 13:19
Redirect with query
<?php
header("Status: 301 Moved Permanently");
header("Location: ./content/index.html".($_GET ? "?".$_SERVER['QUERY_STRING'] : ""));
die();
@pointofpresence
pointofpresence / Create React App - another port
Last active June 16, 2021 14:07
Create React App - another port (on Windows)
"start": "set PORT=3006 && react-scripts start"
@pointofpresence
pointofpresence / index.html
Created June 17, 2021 15:07
Musical Chord Progression Arpeggiator
<article>
<aside id="aside"></aside>
<main id="main"></main>
</article>
@pointofpresence
pointofpresence / auth.php
Last active October 16, 2021 06:56
PHP WWW Authenticate
<?php
$valid_passwords = array ("LOGIN" => "PASSWORD");
$valid_users = array_keys($valid_passwords);
$user = $_SERVER['PHP_AUTH_USER'];
$pass = $_SERVER['PHP_AUTH_PW'];
$validated = (in_array($user, $valid_users)) && ($pass == $valid_passwords[$user]);
@pointofpresence
pointofpresence / Steps.md
Created November 4, 2021 06:57 — forked from tsukhu/Steps.md
create-react-app with styled components

Here are the steps to convert the create-react-app generated to code to use styled components instead of css

  1. Created an app using create-react-app
create-react-app react-styledcomponents-app
  1. Install styled-components as a dependency
@pointofpresence
pointofpresence / Lib.pb
Created January 25, 2022 09:50
PureBasic Library Template
DeclareModule Lib
EnableExplicit
#PublicStaticStringConst$ = "#PublicStaticStringConst$"
#PublicStaticNumericConst = 16
Enumeration PublicEnumeration
#PublicEnumeration_EnumOne
#PublicEnumeration_EnumTwo
EndEnumeration
@pointofpresence
pointofpresence / understanding_slicing.py
Last active March 31, 2024 18:58
Slicing in python
a[start:stop] # items start through stop-1
a[start:] # items start through the rest of the array
a[:stop] # items from the beginning through stop-1
a[:] # a copy of the whole array
@pointofpresence
pointofpresence / python_type_check.py
Last active March 31, 2024 18:45
Python: Проверка типа переменной
# Use the type() builtin function:
i = 123
type(i)
# <type 'int'>
type(i) is int
# True
i = 123.456
@pointofpresence
pointofpresence / walrus_operator.py
Last active March 31, 2024 12:15
Внутри цикла while используется оператор присваивания :=, который появился в Python 3.8. Он читает очередную строку из файла с помощью метода readline() и присваивает ее переменной line.
with open(filename) as file:
while line := file.readline():
print(line.rstrip())