Skip to content

Instantly share code, notes, and snippets.

View nealfennimore's full-sized avatar
:shipit:
RGlkIHlvdSBhbHNvIGRlY29kZSB0aGlzPw==

Neal Fennimore nealfennimore

:shipit:
RGlkIHlvdSBhbHNvIGRlY29kZSB0aGlzPw==
View GitHub Profile
@kevincennis
kevincennis / flippinawesome.js
Created November 4, 2013 03:37
Better timing
var audio = new window.webkitAudioContext(),
position = 0,
scale = {
g: 392,
f: 349.23,
e: 329.63,
b: 493.88
},
song = "gfefgg-fff-gbb-gfefggggffgfe---";
@xeoncross
xeoncross / ajax.js
Last active August 3, 2023 06:06
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {
@cletusw
cletusw / .eslintrc
Last active February 29, 2024 20:24
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@paulirish
paulirish / what-forces-layout.md
Last active May 6, 2024 07:54
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
@SuperPaintman
SuperPaintman / npm-f3-install.sh
Last active April 21, 2024 23:41
NPM install for low RAM machins. And "npm install ... killed" problem
#!/bin/bash
#
# Author: SuperPaintman <SuperPaintmanDeveloper@gmail.com>
#
###
# Constants
###
RETVAL=0
import {createStore} from 'redux';
import reducers from './reducers';
const localState = JSON.parse(localStorage.getItem('malla-store'));
const store = createStore(reducers, localState);
// Let's write the store to local storage every time it changes
let timer;
store.subscribe(() => {
clearTimeout(timer);
@ankurk91
ankurk91 / github_gpg_key.md
Last active April 9, 2024 16:34
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@andrejcremoznik
andrejcremoznik / k780.md
Last active April 12, 2024 07:09
Logitech K780 switch media and function keys on linux

Media/function keys on K780

K780 doesn't have a hard switch to lock the function keys. Logitech provides a utility to do this on Windows and iOS but not on Linux. You need to manually remap the keys.

Below works for Arch Linux, other systemd based distros should be about the same.

There's a problem with the F1-F3 keys as they're hardware specific and don't emit an event if pressed on their own and therefore can't be remapped. I might be wrong as I haven't spend any time on researching that.

Edit: about htat, see @tangruize comments below https://gist.github.com/andrejcremoznik/e56234138305226abd41fe4d1d2561a3#gistcomment-3390489

@aviskase
aviskase / Postman.desktop
Last active November 21, 2023 20:56
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@snambi
snambi / ubuntu_16.04_set_mouse_speed.md
Last active June 8, 2020 09:24
Ubuntu 16.04 Adjust mouse/track pad speed and configure tap-to-click

Ubuntu 16.04 xinput

Setup Mouse/Touchpad speed and configure tap-to-click on the touch pad

display all input devices

xinput --list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ USBest Technology SiS HID Touch Controller	id=11	[slave  pointer  (2)]
⎜   ↳ Elan Touchpad                           	id=14	[slave  pointer  (2)]