Skip to content

Instantly share code, notes, and snippets.

@noirbizarre
noirbizarre / export_as_csvs.py
Created April 17, 2019 14:27
Export LibreOffice Calc sheets to individual CSV files
'''
A LibreOffice Calc Python macro exporting each sheet to an individual CSV file.
The CSV will be named <sheet name>.csv and will be sibling the source file.
To use this macro, store this file in your LibreOffice Python Scripts dir,
ie. `~/.config/libreoffice/4/user/Scripts/python/` on Linux
'''
import os

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone [email protected]:<hash>.git     # or with ssh
@paulirish
paulirish / what-forces-layout.md
Last active January 15, 2025 11:10
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@SanCoder-Q
SanCoder-Q / synology.startup
Created December 25, 2017 14:29
Synology NAS - How to make a program run at startup
Synology NAS - How to make a program run at startup
The other day I created a little node.js project to keep track of some finances. Synology has a node.js package but that just installs the tools - it has no 'container' or any other support to drop files and have it run automagically. Maybe one day.
In the meantime, you can start your project when you SSH into the NAS. My project has a 'www' script which bootstraps my project, so to start I simply type 'node bin/www' from the project directory. But, it only runs while I'm logged in, and if I log out for any reason, the process dies. That's hardly useful when I'm away from home, or on a different PC. So I decided to have a look at starting my project as a Linux service.
After doing a lot of research into how Synology does services, and a few failed attempts at init scripts, I found that Synology DSM (since version 5 perhaps) bundles Upstart, which is a neat little tool to deal with services on Linux. It's most prevalent on Debian and derivatives (notably Ub
@dgerrells
dgerrells / cargo_no_wasm
Created November 8, 2024 20:52
how fast is rust
[package]
name = "how_fast_is_rust"
version = "0.1.0"
edition = "2021"
[dependencies]
minifb = "0.27"
rand = "0.8"
wasm-bindgen = "0.2.95"
@yezz123
yezz123 / Exploitation.md
Created May 24, 2021 12:09
Pentesting-Exploitation
@drivevinhvien3
drivevinhvien3 / LARP on Ubuntu Server.md
Created January 15, 2025 08:37
LARP on Ubuntu Server

Okay, here's a more detailed explanation of LARP on Ubuntu Server in English:

LARP on Ubuntu Server: A Deep Dive

LARP, in the context of web development, stands for Linux, Apache, MySQL, and PHP/Python/Perl. It represents a popular and robust software stack used for hosting dynamic websites and web applications. This acronym breaks down as follows:

  • Linux (Operating System): This forms the foundational operating system layer of the stack. In this case, we're specifically focusing on Ubuntu Server, a variant of the Linux operating system tailored for server environments.
  • Apache (Web Server): The Apache HTTP Server is a widely-used web server responsible for handling HTTP requests from clients (like web browsers) and serving back the appropriate web content (HTML pages, images, etc.). It acts as the intermediary between the user and the server-side logic and data.
  • MySQL (Database Management System): MySQL is a relational database management system (RDBMS) used for storing,
@yifanzz
yifanzz / code-editor-rules.md
Created December 17, 2024 00:01
EP12 - The One File to Rule Them All

[Project Name]

Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

Project Context

[Brief description ]

  • [more description]
  • [more description]
  • [more description]

setup adb

Add platform-tools to your path

echo 'export ANDROID_HOME=/Users/$USER/Library/Android/sdk' >> ~/.bash_profile
echo 'export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools' >> ~/.bash_profile

Refresh your bash profile (or restart your terminal app)

source ~/.bash_profile
@wuriyanto48
wuriyanto48 / README.md
Created January 17, 2021 05:51
Install Maven on Ubuntu

Install Java and Maven on Ubuntu

Install JRE and JDK

install JDK

$ sudo apt-get install default-jdk
$ javac -version