Skip to content

Instantly share code, notes, and snippets.

@corei8
corei8 / printDiv.js
Created December 12, 2019 14:08
[Print a <div> in Javascript] #javascript #print
function printdiv() {
var a = window.open('', ''. 'width = 600, height = 800');
a.document.open('text/html');
a.document.write(document.getElementById('print_me').innerHTML);
a.document.close();
a.print();
}
@corei8
corei8 / run.py
Created December 12, 2019 14:10
[Render webpage with Flask] basic Flask application #python #flask
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "<h1>Hello, World!!</h1>"
if __name__ == "__main__":
app.run()
@corei8
corei8 / center.css
Last active January 3, 2020 22:53
[Center image on page with position: fixed] #css
img {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@corei8
corei8 / enterInTerminal.txt
Created January 6, 2020 22:24
[Enable Sidecar in older Macs] #mac #sidecar #bash
defaults write com.apple.sidecar.display AllowAllDevices -bool true; defaults write com.apple.sidecar.display hasShownPref -bool true; open /System/Library/PreferencePanes/Sidecar.prefPane
@corei8
corei8 / make_databse.txt
Created January 8, 2020 18:42
[Make database with SQLAlchemy] #sqlalchemy #python
>>> from yourapplication import db
>>> db.create_all()
@corei8
corei8 / ssh_using_key
Created April 24, 2020 00:48
[SSH using a key on MoacOS] #ssh #key #macos
$ ssh -i path/to/Key.pem user@127.0.0.1
@corei8
corei8 / derekBanascheatsheet.tex
Created July 29, 2021 23:38
latex cheatsheet from Derek Banas
% Document will be printed on a4 paper, using the 12pt default font
% Define that we want to use the report class template
% Other classes : article, book, letter, slides and others
% In the preamble we define document wide rules
% Commands start with a name [optional arguments] {required arguments}
@corei8
corei8 / guide.tex
Last active October 23, 2021 18:36
corei8 Latex Guide
% !TEX program = lualatex
\documentclass[11pt]{amsbook}
% book --> good for bound material, margins are designed for binding.
% article --> title appears at the head of the fist page; margins are even.
% report --> same as article, but the title is seperate page.
\usepackage{geometry}
\geometry{
paperheight=8.5in,
@corei8
corei8 / main.tex
Last active October 23, 2021 18:36
GregorioTeX Preamble
% !TEX program = lualatex
\documentclass{amsbook}
\author{}
\usepackage{geometry}
% BOOKLET:
%\geometry{paperheight=8.5in, paperwidth=5.5in, top=0.5in, bottom=0.5in, inner=0.5in, outer=0.5in,}
% LETTERPAPER:
name: incipit;
gabc-copyright: copyright on this gabc file;
score-copyright: copyright on the source score;
office-part: introitus/...;
occasion: in church calendar;
meter: for metrical hymns;
commentary: source of words;
arranger: name of arranger;
author: if known;
date: xi c;