Skip to content

Instantly share code, notes, and snippets.

View trivett's full-sized avatar
🚲
Bikes + JavaScript

Vincent trivett

🚲
Bikes + JavaScript
View GitHub Profile
@prabeshmagar
prabeshmagar / Fix L2TP VPN in Ubuntu 22.04 and PopOs 22.04.md
Last active May 7, 2022 14:32
Fix L2TP VPN in Ubuntu 22.04 and PopOs 22.04

Fix L2TP VPN in PopOs 22.04

Step 1

sudo apt remove --purge xl2tpd

Step 2

wget http://archive.ubuntu.com/ubuntu/pool/universe/x/xl2tpd/xl2tpd_1.3.12-1.1_amd64.deb

Step 3

sudo dpkg -i xl2tpd\_1.3.12-1.1\_amd64.deb

💜 FairyShell v 0.1 💜

A Windows Terminal Theme based on @sailorhg's Fairy Floss theme

N.B. This uses Powershell as my shell but you can change this by changing the commandline value in the profile below!

Instructions:

Optional pre-setup

  • If you want the font I use here install instructions can be found here else Consolas is a fine replacement untill Cascadia is out 💖
  • If you want the Fairy Floss graphic in the background, you can get it from here and save it to the directory where your profile.json file is stored in the next step.
@fawkesley
fawkesley / 30-randomize-mac-address.conf
Last active May 22, 2022 21:42
MAC address randomization in Ubuntu 17+ (>= 1.4.1): save to /etc/NetworkManager/conf.d/
# /etc/NetworkManager/conf.d/30-randomize-mac-address.conf
# REQUIRES NETWORK MANAGER >= 1.4.1 (Ubuntu Zesty and above)
# Thanks to https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/
# This randomize your MAC address for *new* connections
# Be sure to change your existing (saved) connections in
# /etc/NetworkManager/system-connections/*
@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active June 26, 2024 15:54
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active April 2, 2024 20:18
Moving to ES6 from CoffeeScript

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

@dannguyen
dannguyen / easypipe.py
Last active February 10, 2022 16:45
Using scikit-learn to classify NYT columnists
# some convenience functions here, nothing new
'''
# usage:
from easypipe import easy_pipeline
from easypipe import print_metrics
data_folder = "data-hold/20news"
p = easy_pipeline()
print_metrics(p, data_folder)
'''
@obfusk
obfusk / break.py
Last active May 1, 2024 20:32
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@danharper
danharper / background.js
Last active June 29, 2024 19:32
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});