This file contains 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
// ==UserScript== | |
// @name Copy code from SX | |
// @namespace https://gist.github.com/kpym/30d90be41ab5c248cdf7 | |
// @version 0.3 | |
// @description This script use clipboard.js to add copy button for code sections on SX. When you hover a code the button "</>" appear on the top right corner. Click it and the code is copied. | |
// @author kpym | |
// @match *://*.stackexchange.com/* | |
// @match *://*.stackoverflow.com/* | |
// @match *://*.superuser.com/* | |
// @match *://*.serverfault.com/* |
This file contains 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
\documentclass[tikz]{standalone} | |
\usetikzlibrary{math} | |
\begin{document} | |
\begin{tikzpicture}[scale=.03pt] | |
\tikzmath{ | |
% -------------------------- | |
% the parameters of the tree | |
% -------------------------- | |
\power=2.3; % the scale base factor | |
\deviation=70; % the angle between the 3 child edges |
This file contains 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
\documentclass[tikz]{standalone} | |
\usetikzlibrary{math,spy} | |
\tikzmath{ | |
let \startcolor=blue; let \endcolor=red; % --- the start and end colors | |
function FordCircles(\a,\b,\n){ | |
int \p, \q; % ------------------------------ p and q are integers | |
for \q in {1,...,\n}{ % -------------------- 0 < q <= n | |
int \mix; \mix = 100*(\q-1)/(\n-1); % ---- color mix parameter in [0,100] | |
for \p in {\a*\q,...,\b*\q}{ % ----------- a < p/q < b <=> [aq] < p < [bq] | |
if gcd(\p,\q) == 1 then { % ------------ if the fraction is irreducible |
This file contains 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
\documentclass[tikz]{standalone} | |
\usetikzlibrary{math} | |
\tikzmath{ | |
function sinc(\x) { | |
if abs(\x) < .001 then { % (|x| < .001) ~ (x = 0) | |
return 1; | |
} else { | |
return sin(\x r)/\x; | |
}; | |
}; |
This file contains 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
\documentclass[tikz]{standalone} | |
\usetikzlibrary{math} | |
\tikzmath{ | |
function FordCircles(\a,\b,\n){ | |
int \p, \q; % ------------------------------ p and q are integers | |
for \q in {1,...,\n}{ % -------------------- 0 < q <= n | |
for \p in {\a*\q,...,\b*\q}{ % ----------- a < p/q < b <=> [aq] < p < [bq] | |
if gcd(\p,\q) == 1 then { % ------------ if the fraction is irreducible | |
\f = \p/\q; % ------------------------ evaluate the tuch point f = p/q | |
\r = 1/(2*\q*\q); % ------------------ evaluate the radius r = 1/2q^2 |
NewerOlder