Skip to content

Instantly share code, notes, and snippets.

@mikepruett3
mikepruett3 / shell-setup.ps1
Last active May 9, 2024 17:09
Packages to install via scoop, winget, choco, and other tools...
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018
@joepie91
joepie91 / vpn.md
Last active May 9, 2024 17:09
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@barronh
barronh / tempo_geoxo_meeting.ipynb
Last active May 9, 2024 17:09
TEMPO_GeoXO_Meeting.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@madkoding
madkoding / install-docker-deepin.sh
Last active May 9, 2024 17:08
Install Docker-CE script for Deepin Linux
#!/bin/bash
echo "Starting Docker installation on Deepin Linux..."
# Define a mapping from Deepin version to Debian version
map_deepin_to_debian() {
if [ "$1" -lt 20 ]; then
echo "stretch"
elif [ "$1" -ge 20 ]; then
echo "buster"

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

class Admins::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def google_oauth2
admin = Admin.from_google(from_google_params)
if admin.present?
sign_out_all_scopes
flash[:success] = t 'devise.omniauth_callbacks.success', kind: 'Google'
sign_in_and_redirect admin, event: :authentication
else
flash[:alert] = t 'devise.omniauth_callbacks.failure', kind: 'Google', reason: "#{auth.info.email} is not authorized."
@stephancasas
stephancasas / toggle-ventura-sidecar.jxa.js
Last active May 9, 2024 17:05
Toggle sidecar or screen mirroring from Control Center in macOS Ventura
#!/usr/bin/env osascript -l JavaScript
/**
* -----------------------------------------------------------------------------
* Activate Sidecar/Screen Mirroring from Control Center
* -----------------------------------------------------------------------------
*
* Created on February 17, 2023 by Stephan Casas
* Updated on May 18, 2023 by Stephan Casas
*
@shunia
shunia / Send_Key_To_Background_Application.swift
Created July 9, 2021 09:39
MacOS send keystroke to background application
import Foundation
import CoreFoundation
// all keycodes: https://gist.github.com/swillits/df648e87016772c7f7e5dbed2b345066
let KeyCode_R: UInt16 = 0x0F;
let KeyCode_N: UInt16 = 0x2D;
let src = CGEventSource(stateID: CGEventSourceStateID.hidSystemState)
let kspd = CGEvent(keyboardEventSource: src, virtualKey: KeyCode_R, keyDown: true) // space-down
let kspu = CGEvent(keyboardEventSource: src, virtualKey: KeyCode_R, keyDown: false) // space-up
@dhh
dhh / linux-setup.sh
Last active May 9, 2024 17:04
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@meyer9
meyer9 / skeleton.py
Created July 6, 2014 17:43
PyGame Skeleton
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((640, 480))
running = 1
while running:
for event in pygame.event.get():