Skip to content

Instantly share code, notes, and snippets.

@bubba-h57
bubba-h57 / instructions.md
Last active October 23, 2023 12:46
Configuring Jetbrains Gateway and WSL

Step 1: SSH Daemon

In your WSL instance, re-install OpenSSH server as follows.

sudo apt remove --purge openssh-server
sudo apt install openssh-server

Edit /etc/ssh/sshd_config (e.g. sudo vi /etc/ssh/sshd_config) and add the following lines to the bottom of the file. Ensure you replace WSL_ACCOUNT_NAME with your WSL2 account name.

@borekb
borekb / README.md
Last active April 2, 2024 19:56
How to link to headings in GitHub issues and pull requests

How to link to headings in GitHub issues and pull requests

If you have an issue comment / PR description on GitHub, it doesn't automatically get anchors / IDs that you could link to:

Screenshot 2019-07-11 at 13

What I like to do is to add a visible # character like this:

Screenshot 2019-07-11 at 13 42 21

@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active April 9, 2024 14:08
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@veuncent
veuncent / aws_glacier_delete_vault.md
Last active May 6, 2024 20:45
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 
@mikelehen
mikelehen / generate-pushid.js
Created February 11, 2015 17:34
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@pachacamac
pachacamac / IdleBlur.js
Last active October 9, 2022 03:55
JavaScript Bookmarklet: Automatically Blur Websites When You Are Idle
javascript:(function(){
var delay=10000, intensity=10, timer;
function resetTimer(){clearTimeout(timer); timer = setTimeout(blur, delay);}
function activity(){document.documentElement.setAttribute('style',''); resetTimer();}
function blur(){document.documentElement.setAttribute('style', 'filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'blur\'><feGaussianBlur stdDeviation=\''+intensity+'\' /></filter></svg>#blur");-webkit-filter:blur('+intensity+'px);filter:blur('+intensity+'px);');}
['mousemove', 'keypress', 'scroll'].forEach(function(e){document.addEventListener(e, activity, false);});
resetTimer();
})();void(0);
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@cowboy
cowboy / awesome.js
Created August 12, 2014 15:18
this code from amazon.com's source is... well, just... what web development is all about
document.write = (function(write){
var override = function() {
if(document.readyState !== "loading") { // document has finished loading - we want to intercept this call to document.write
if (window.ueLogError) {
try {
throw new Error("`document.write` called after page load on the gateway.");
}
catch(e) {
ueLogError(e, { logLevel : 'ERROR', attribution: 'gw-third-party-js' });
}
@laracasts
laracasts / ApiTester.php
Last active February 6, 2020 15:57
Incremental APISs: Refactoring Tests and Traits
<?php
use Faker\Factory as Faker;
abstract class ApiTester extends TestCase {
/**
* @var Faker
*/
protected $fake;
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert