Skip to content

Instantly share code, notes, and snippets.

View vicapow's full-sized avatar

Victor vicapow

View GitHub Profile
@vicapow
vicapow / main.tex
Last active November 11, 2024 00:19
Avoid overlapping axis labels and show correct legend item using `forget plot` See a live version at: https://crixet.com/?gist=e6c41b3f283ffca6548cd923cd154969
% Original Tex question at: https://tex.stackexchange.com/questions/730485/difficulty-changing-legend-marker-and-resizing-in-pgfplots
\documentclass{article}
\usepackage{pgfplots}
\usepackage{amsmath}
\pgfplotsset{compat=1.18}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
@vicapow
vicapow / main.tex
Created November 11, 2024 00:10
Avoid overlapping axis labels and show correct legend item using `forget plot`
\documentclass{article}
\usepackage{pgfplots}
\usepackage{amsmath}
\pgfplotsset{compat=1.18}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\pagestyle{empty}
\begin{tikzpicture}[scale=1]
@vicapow
vicapow / main.tex
Created November 10, 2024 22:41
Example of using tcolorbox in Latex / Ejemplo de uso de tcolorbox en LaTeX
\documentclass{article}
\usepackage{tcolorbox}
\newtcolorbox{shadedsection}[1][]{ % Custom box with options / Caja personalizada con opciones
colback=blue!20, % Background color of the box / Color de fondo de la caja
colframe=blue!50, % Border color of the box / Color del borde de la caja
boxrule=0pt, % Border thickness (0pt = no border) / Grosor del borde (0pt = sin borde)
width=\textwidth, % Box width, same as the text width / Ancho de la caja, igual al ancho del texto
sharp corners, % No rounded corners / Sin esquinas redondeadas
left=0pt, right=0pt, top=2pt, bottom=2pt, % Padding / Relleno
@vicapow
vicapow / main.tex
Last active November 3, 2024 20:19
Attempting to replicate the gradetable macro of the exam package in Latex
% In response to the stackexchange question: https://tex.stackexchange.com/questions/680066/customising-gradetable-to-group-multiple-choice-into-1-column-with-the-exam-cl
% You can compile and view the pdf version of this Latex document at: https://crixet.com/?gist=d433f7deda0eb630dad9b98bb3b281b9
\documentclass[addpoints]{exam}
\usepackage{tabularx}
\usepackage{xcolor}
\usepackage{multicol}
\begin{document}
@vicapow
vicapow / main.tex
Last active November 3, 2024 06:27
% Original question on Reddit: https://www.reddit.com/r/LaTeX/comments/1gi75el/these_commands_arent_working_any_help/
% To view the source code or fork it, see: https://gist.github.com/vicapow/fd736f10b9382e924875f4e093a63d33
% Note, you may need to compile twice to ensure the refernces get updated completely.
\documentclass{article}
\usepackage{amsmath} % Required for split and align environments
@vicapow
vicapow / test1.txt
Last active November 2, 2024 22:17
test
test 1
(async function() {
async function fetchData(date) {
var date_split = date.split('-'),
year = date_split[0],
month = date_split[1],
day = date_split[2];
if (parseInt(day) < 10){
day = parseInt(day);
}
month = parseInt(month) - 1;
@vicapow
vicapow / main.cpp
Created June 29, 2020 17:35
C++ rvalue reference and move semantics
#include <iostream>
#include <vector>
using namespace std;
struct A {
int * ptr;
A() {
cout << "Constructor" << endl;
ptr = new int;
@vicapow
vicapow / remove-lodash-es.js
Created March 6, 2020 21:46
convert lodash-es back to lodash
export default function transformer(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
let body;
root.find(j.Program).map(program => {
body = program.value.body;
});
const lodashImports = root
@vicapow
vicapow / styled-components_v4.x.x.js
Created February 12, 2019 04:03
styled-components_v4.x.x.js
// @flow
declare module 'styled-components' {
// { type: '__styled' } is really only used ot avoid type collisions
// betwteen the interpolation unions types of (props: P) => string | number)
// and StyledComponent<any>.
declare export type StyledComponent<Props> = { type: '__styled' } & React$ComponentType<Props>;
declare export type Interpolation<P> =
| StyledComponent<any> // Order seems to matter unexpectedly.