Skip to content

Instantly share code, notes, and snippets.

View kuzmicheff's full-sized avatar

Andre Kuzmicheff kuzmicheff

View GitHub Profile
@leemm
leemm / gist:ab82d8bb91f899b3540787155524d776
Last active February 16, 2023 23:25
Installing and configuring nvidia drivers in clean Elementary OS 6.x install, including gamemode and prime-run (if indemand)
To install nvidia drivers (based on 515.48.07 at the time of writing) in a clean elementary os 6.1 Jolnir install. DON'T use the driver listed in the eos store.
// Install the toolchain
sudo apt install build-essential
sudo apt install software-properties-gtk
sudo apt install software-properties-common
sudo apt install linux-headers-$(uname -r)
// Install the drivers
sudo add-apt-repository ppa:graphics-drivers/ppa
@harmancode
harmancode / gist:84c06855907975903583f79dcc67440a
Last active January 13, 2023 22:37
How to fix opendir operation not permitted error from rsync on macOS Catalina
## How to fix opendir operation not permitted error from rsync on macOS Catalina
by Ertugrul Harman (twitter.com/harmancode - github.com/harmancode)
27 Dec 2020
I was getting opendir operation not permitted error from rsync on macOS Catalina.
The command I was using: rsync -vaE --progress /Volumes/SourceName /Volumes/DestinationName
Source: https://apple.stackexchange.com/a/117469/65292
@Component({
selector: 'add-story-form',
template: `
<div class="container">
<h1>New Story</h1>
<form [formGroup]="newStory"
(submit)="submit($event)"
(success)="onSuccess()"
(error)="onError($event)"
connectForm="newStory">
@infusion
infusion / recursive-primitive.js
Last active February 2, 2020 22:10
An implementation of primitive operations like addition, multiplication and so on - recursively!
/**
* @license Recursive-Primitive.js
*
* Copyright (c) 2014, Robert Eisele ([email protected])
* Dual licensed under the MIT or GPL Version 2 licenses.
**/
const add = (a, b) => b === 0 ? a : add(a + 1, b - 1);
const sub = (a, b) => b === 0 ? a : sub(a - 1, b - 1);
const mul = (a, b) => b === 1 ? a : add(mul(a, b - 1), a);
@paulirish
paulirish / what-forces-layout.md
Last active November 19, 2024 08:58
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
.fadeinDown {
-webkit-animation: fadeInDown 500ms ease-in-out; /* Chrome, Safari, Opera */
animation: fadeInDown 500ms ease-in-out;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes fadeInDown {
0% {
@alexhawkins
alexhawkins / binaryTree.js
Last active October 16, 2022 20:27
Binary Trees and Tree Traversal
'use strict';
function BinarySearchTree() {
this.root = null;
}
BinarySearchTree.prototype.makeNode = function(value) {
var node = {};
node.value = value;
node.left = null;
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active September 15, 2024 20:33
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@joyrexus
joyrexus / README.md
Last active November 5, 2024 14:17 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",