Skip to content

Instantly share code, notes, and snippets.

@pollardld
pollardld / arrowfunction.js
Last active May 1, 2023 17:54
JS Arrow Function
/**
* Ways to write an arrow function with args
**/
// 1. Way
const uWhat = what => 'You ' + what;
// 1. e.g.
var whatUDid = '__Did What?__';
uWhat(whatUDid);
@stephenkeating
stephenkeating / .xml
Created October 31, 2019 15:59
Automated Git Pull Script
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.gitPullLectureCode</string>
<key>ProgramArguments</key>
<array>
<string>git</string>
<string>-C</string>
@mikowl
mikowl / oneliners.js
Last active June 29, 2024 17:39
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);
@MuhsinFatih
MuhsinFatih / fix-macos-python.md
Last active July 28, 2024 23:23
How to recover from messed up python installation on mac, and never have to mess with apple's shitty python confusion factory

I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.

What the hell?

Here is what I had messed up, which you also probably did:

  • I had too many different python interpreters
  • Too many different symlinks which I lost track of
  • almost no package I installed with pip worked without a headache
  • any attempt to fix using online resources made it worse.
const i = 'gfudi';
const k = s => s.split('').map(c => String.fromCharCode(c.charCodeAt() - 1)).join('');
self[k(i)](urlWithYourPreciousData);
const linkEl = document.createElement('link');
linkEl.rel = 'prefetch';
linkEl.href = urlWithYourPreciousData;
document.head.appendChild(linkEl);
@ilyar
ilyar / Vagrantfile.md
Created June 8, 2017 16:45
Find out current OS inside Vagrantfile

Add this into your Vagrantfile:

module OS
    def OS.windows?
        (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
    end

    def OS.mac?
 (/darwin/ =~ RUBY_PLATFORM) != nil
@hkasera
hkasera / names.json
Last active September 29, 2020 04:49
Team Names
[
"xterm-inate",
"DEADBEEF",
"hackslash",
"SQL Injectors",
"Hexspeak",
"The Brogrammers",
"GitHub Says What?",
"Bits Please",
"SaaStar",