Skip to content

Instantly share code, notes, and snippets.

@Lexxos
Lexxos / trim-canvas.js
Created November 5, 2021 02:30 — forked from remy/trim-canvas.js
Trims the surrounding transparent pixels from a canvas
// MIT http://rem.mit-license.org
function trim(c) {
var ctx = c.getContext('2d'),
copy = document.createElement('canvas').getContext('2d'),
pixels = ctx.getImageData(0, 0, c.width, c.height),
l = pixels.data.length,
i,
bound = {
top: null,
@Lexxos
Lexxos / Isolate CPU Ubuntu.md
Created October 27, 2021 07:05 — forked from mjm522/Isolate CPU Ubuntu.md
Isolate CPU core to run Python code Ubuntu

Note: To run a process dedicated on a CPU you can use the tasket command. For example

taskset -c 5,11 python -m timeit 'sum(range(10**7))'

However, this will not guarantee that the CPUs 5,11 will be used for that process alone. The same CPU can be interrupted by the scheduler and may not be properly isolated. So inorder to isolate the CPU the following steps are to be taken. Another feature that could be turned off for these CPUs are the interrupt feature 'IRQ'. However this is not covered here.

  1. List all available cores and hyperthreads in your processor.
lscpu --all --extended
@Lexxos
Lexxos / SEO.md
Created October 17, 2021 04:03 — forked from denzildoyle/SEO.md
I short list of SEO tips and tricks I have learned over time

SEO

In this list, I will be typically be talking SEO as it relates to Google because Google will likely account for the vast majority of your inbound search traffic. Additionally, if you rank highly on Google, you will probably do well on other search engines anyway. Just like in football if you could play in the Major league you would most likely kill it in the minor league I would begin by explaining why SEO is important talk a little bit about what SEO is about and talk about how those concepts relate to the world wide web. Then talk about some of the things you could do to optimize your site from top to bottom of a typical webpage.

Why it's important

  • When you want to hide something on google put it on the second page. #SEO @searchdecoder
  • Winner takes almost everything
  • More than 80 percent of shoppers research big purchases online first
  • Opertunity for business
  • 88% Of Consumers Trust Online Reviews As Much As Personal Recommendations
  • 72% Of Consumers Say That Positive Reviews Make Them T
@Lexxos
Lexxos / speedup.bat
Last active September 9, 2021 21:42 — forked from id4ehsan/speedup.bat
Increase Internet Speed
ipconfig /all
ping -t 192.168.12.1
ipconfig /renew
ipconfig /flushdns
netsh interface tcp set global autotuning=disable
netsh interface tcp set heuristics disabled