Skip to content

Instantly share code, notes, and snippets.

View pxslip's full-sized avatar

Will K (pxslip) pxslip

View GitHub Profile
// @ts-nocheck
// before
const obj = { a: true };
Object.prototype.hasOwnProperty.call(obj, 'a');
// after
const obj = { a: true };
Object.hasOwn(obj, 'a');
@pxslip
pxslip / matcher.js
Last active November 7, 2019 20:27
Quick and dirty matching tool
const args = process.argv.slice(2);
const names = args[0].split(',');
const usedIndices = [];
names.forEach(name => {
let rand = Math.floor(Math.random() * names.length);
let other = names[rand];
while (other === name || usedIndices.includes(rand)) {
rand = Math.floor(Math.random() * names.length);
other = names[rand];
@pxslip
pxslip / animatedScrollTo.js
Created March 12, 2018 14:09 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@pxslip
pxslip / 20-xdebug.ini
Created March 9, 2018 15:46
Homestead xdebug ini
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_autostart = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 512
xdebug.remote_log = /home/vagrant/xdebug/xdebug.log
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = /home/vagrant/profiler
@pxslip
pxslip / git-cheat-sheet.md
Last active March 14, 2022 17:06
Git cheat sheet

Git cheat list

  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
  • setting up a character used for comments

    git config core.commentchar <HERE_COMES_YOUR_COMMENT_CHAR>
    

Keybase proof

I hereby claim:

  • I am pxslip on github.
  • I am pxslip (https://keybase.io/pxslip) on keybase.
  • I have a public key ASA8j8kDWvJ9Tsa2hVk1zVzq2vn-lmfbFvdm9NQ0_Hhjngo

To claim this, I am signing this object:

@pxslip
pxslip / Vagrantfile
Created September 28, 2015 17:40 — forked from aweijnitz/Vagrantfile
This is a Vagrant file and a provisioning script to create a Debian-based Jenkins server, including Java, Ant and Tomcat. Also see "provision.sh" below
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
# Named boxes, like this one, don't need a URL, since the are looked up
@pxslip
pxslip / autoexec.cfg
Last active December 30, 2015 18:04
My Dota 2 autoexec file - still a work in progress
//first unbind all old key bindings, and clear the console(?)
unbindall
clear
//////////////
// SETTINGS //
//////////////
con_enable "1"
@pxslip
pxslip / brew-sync.sh
Last active December 29, 2015 02:39 — forked from jpawlowski/brew-sync.sh
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
# Also syncs gui applications installed using brew-cask (https://github.com/phinze/homebrew-cask)
# Modified from https://gist.github.com/jpawlowski/5248465
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
$BREW tap > /tmp/brew-sync.taps