Skip to content

Instantly share code, notes, and snippets.

View ctsstc's full-sized avatar
🔥
me = new Person(new Year(2019+5));

Cody Swartz ctsstc

🔥
me = new Person(new Year(2019+5));
View GitHub Profile
@Dan-Q
Dan-Q / _no_code_page_.php
Last active May 3, 2024 08:46
Hacky PHP to produce a "blank" web page which somehow has content when viewed in Firefox. Sample page at https://danq.me/wp-content/no-code-webpage/, explanation at https://danq.me/nocode
<?php
// half-hearted CSS minification
$css = preg_replace(
array('/\s*(\w)\s*{\s*/','/\s*(\S*:)(\s*)([^;]*)(\s|\n)*;(\n|\s)*/','/\n/','/\s*}\s*/'),
array('$1{ ','$1$3;',"",'} '),
file_get_contents('linked.css')
);
// embed as a data: uri
$base64css = rtrim(strtr(base64_encode($css), '+/', '-_'), '=');
@amalmurali47
amalmurali47 / backup_digitalocean.md
Last active April 24, 2024 21:33
Backup DigitalOcean droplet locally

DigitalOcean does not provide a way to download a snapshot of your droplet locally. You can use rsync to accomplish this instead.

On your local machine, assuming you have added your-server in your SSH config:

rsync -aAXHv --append-verify --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} your-server:/
  • -a : archive mode (all files, with permissions, etc.)
  • -A : preserve ACLs/permissions (not included with -a)
@ybakos
ybakos / _resources.md
Last active January 4, 2020 21:07
Level Up C: Resources
@zmts
zmts / fingerprint.md
Last active July 26, 2023 08:12
Get browser fingerprint example (fingerprintjs2)

Get browser fingerprint example (fingerprintjs2)

import * as Fingerprint2 from 'fingerprintjs2'
import * as UAParser from 'ua-parser-js'

function _getFingerprint () {
  return new Promise((resolve, reject) => {
    async function getHash () {
      const options = {

Keybase proof

I hereby claim:

  • I am ctsstc on github.
  • I am cts_ae (https://keybase.io/cts_ae) on keybase.
  • I have a public key ASDQOl_GG3phDr6YpOItUyepXklobgEzcpseci1Jr5YwFAo

To claim this, I am signing this object:

@ctsstc
ctsstc / kube_commands.rb
Last active October 17, 2019 22:25 — forked from levibrown/kube_commands.rb
A CLI for Common G5 Kube Commands
#!/usr/bin/env ruby
# Setup:
# 1) `gem install highline`
# 2) save this file to a local folder
# 3) rename the file to remove extension `mv kube_commands.rb kube_command`
# 4) change permissions `chmod 755 kube_commands`
# 5) link to your /usr/local/bin `ln -s $PWD/kube_command /usr/local/bin/`
# 6) in a new shell you should now be able to run `kube_commands`
# 7) add new commands and add to this gist
@levibrown
levibrown / kube_commands.rb
Last active July 15, 2019 22:35
a cli for common g5 kube commands
#!/usr/bin/env ruby
# Setup:
# 1) `gem install highline`
# 2) save this file to a local folder
# 3) rename the file to remove extension `mv kube_commands.rb kube_commands`
# 4) change permissions `chmod 755 kube_commands`
# 5) link to your /usr/local/bin `ln -s $PWD/kube_commands /usr/local/bin/`
# 6) in a new shell you should now be able to run `kube_commands`
# 7) add new commands and add to this gist
@mohsenkhanpour
mohsenkhanpour / readme.md
Last active February 12, 2024 16:56
WSL Installation

Installing the distro:

Make Windows ready:

Open PowerShell as Administrator and run:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Restart your computer when prompted.

Install distro:

@ctsstc
ctsstc / tabs-outliner-collapse-all.js
Last active June 15, 2023 19:24
Tabs Outliner - Collapse All
treeView.treeModel.currentSession_rootNode.subnodes.forEach(node => node.setCollapsing(true))