Skip to content

Instantly share code, notes, and snippets.

@maxim75
maxim75 / exif.html
Created May 19, 2011 06:03
Reading EXIF info from image with JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<title>h5</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
<script src="exif.js"></script>
<style>
#holder { border: 1px dashed #ccc; width: 100px; height: 100px; margin: 20px auto;}
#holder.hover { border: 1px dashed #333; }
#result .property { width: 100px; }
@luser-dr00g
luser-dr00g / xcr.c
Created August 30, 2014 09:35
xcb+cairo hello world window
//xcr.c
//cc -o xcr $(pkg-config --cflags --libs cairo xcb xcb-icccm) xcr.c -lcairo -lxcb -lxcb-icccm
#include <stdlib.h>
#include <string.h>
#include <cairo.h>
#include <cairo-xcb.h>
#include <xcb/xcb.h>
#include <xcb/xcb_image.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_icccm.h>
@ninrod
ninrod / workflowy-to-org-mode.el
Created July 7, 2016 20:30
Convert from Workflowy export format to Org-Mode
(defun workflowy-to-org-mode ()
(interactive)
(let (count)
(while (not (eobp))
(setq count 0)
(while (looking-at " ")
(setq count (1+ count))
(forward-char 1))
(forward-char 1)
(delete-region (point-at-bol) (point))
@bitsurgeon
bitsurgeon / youtube.md
Last active June 20, 2024 13:20
Markdown cheatsheet for YouTube

Embed YouTube Video in Markdown File

  1. Markdown style
[![Watch the video](https://img.youtube.com/vi/nTQUwghvy5Q/default.jpg)](https://youtu.be/nTQUwghvy5Q)
  1. HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">
@jfeilbach
jfeilbach / grub.md
Last active July 5, 2024 08:32
Make Linux fast

In /etc/default/grub, modify:

noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off 

Then sudo update-grub

from https:// make-linux-fast-again.com/ This domain does not seem to be maintained any longer.

@eugrus
eugrus / pdfmargins
Last active September 20, 2023 15:44
Add 1cm margins left and right to every page of a PDF using pdflatex directly
for INPUT_PDF_FILE in "$@"; do
if [ "$(file -b --mime-type "$INPUT_PDF_FILE")" == "application/pdf" ]; then
OUTPUT_PDF_FILE="${INPUT_PDF_FILE%.pdf}.margins"
pdflatex -jobname "$OUTPUT_PDF_FILE" "\documentclass{article}\usepackage{pdfpages}\begin{document}\includepdf[pages=-,trim=1cm 0cm 1cm 0cm]{$INPUT_PDF_FILE}\end{document}"
else
echo "Skipping non-PDF file: $INPUT_PDF_FILE"
fi
done
@eugrus
eugrus / Keyb Layout Shortcuts.reg
Last active August 10, 2023 19:39
Workaround for the Windows bug rewriting the user's set up keyboard layout switching shortcuts. This hack rewrites the defaults. This one is set up as following: Ctrl+1 - German; Ctrl+2 - Russian; Ctrl+3 - US-English; Ctrl+4 - Canadian Int for French
Windows Registry Editor Version 5.00
[HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys]
[HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys\00000100]
"Virtual Key"=hex:33,00,00,00
"Key Modifiers"=hex:02,c0,00,00
"Target IME"=hex:09,04,09,04
[HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys\00000101]
while ! rsync --partial --progress -avz -e ssh "user@server:/path/folder.to.copy" "/to.local.path"; do sleep 5; done
@marzme
marzme / Convert-WingetTextToObjectBackup.ps1
Last active June 23, 2024 23:53
A PowerShell function that converts the text output from winget into PowerShell objects.
Function Convert-WingetTextToObject {
<#
.SYNOPSIS
Converts the text output from winget commands into custom PowerShell objects.
.DESCRIPTION
Converts the text output from winget commands into custom PowerShell objects.
.PARAMETER WingetRawText