Skip to content

Instantly share code, notes, and snippets.

View xbladesub's full-sized avatar
🦀
Rust !

NSHV xbladesub

🦀
Rust !
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Huluk
Huluk / gist:5117702
Last active December 8, 2023 22:34
Open Files with Terminal Vim by default [mac, iterm]
If you want your terminal vim to open files you double click, follow the following steps (MacOS only):
1. Open Automator
2. Select Application
3. Copy the attached file
4. Save and set as default for opening files
Multiple files are opened in vim tabs.
If there is already a vim instance running, files are opened in it.
@fguchelaar
fguchelaar / .gitignore
Last active January 2, 2022 08:38
.gitignore for Xcode / AppCode
# .gitignore file for Xcode / AppCode projects
# based on https://github.com/github/gitignore/blob/master/Objective-C.gitignore
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
@codeinthehole
codeinthehole / osx_bootstrap.sh
Last active April 28, 2024 15:26
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@simonw
simonw / how-to-upgrade-heroku-postgresql.md
Last active April 29, 2024 05:07
How to upgrade a Heroku PostgreSQL database to a new plan

How to upgrade a Heroku PostgreSQL database to a new plan

I started a project on a Hobby Dev plan (free, limit 10,000 rows), and then later needed to upgrade it to Hobby Basic ($9/month, limit 10,000,000 rows).

After assigning the new database, I had two databases attached to the application. They looked something like this:

  • HEROKU_POSTGRESQL_OLIVE (postgresql-dimensional-3321) Old, free-tier (Hobby Dev) database
@joeybaker
joeybaker / open-in-vi.scrpt
Created June 14, 2018 18:32
Applescript to use in automator to open a file in Terminal in neovim
on run {input}
set filename to POSIX path of input
set cmd to "clear;cd $(dirname " & filename & ");nvim " & quoted form of filename & "; exit"
tell application "System Events" to set terminalIsRunning to exists application process "Terminal"
tell application "Terminal"
activate
if terminalIsRunning is true then
set newWnd to do script with command cmd
else
do script with command cmd in window 1
@MihaelIsaev
MihaelIsaev / Vapor3HTTPClientRequestProxy.swift
Created June 26, 2018 02:49
Example of http request through proxy for Vapor 3
public func boot(_ app: Application) throws {
let config = URLSessionConfiguration.default
config.requestCachePolicy = URLRequest.CachePolicy.reloadIgnoringLocalCacheData
config.connectionProxyDictionary = [AnyHashable: Any]()
config.connectionProxyDictionary?[kCFNetworkProxiesHTTPEnable as String] = 1
config.connectionProxyDictionary?[kCFNetworkProxiesHTTPProxy as String] = "proxy-server.com"
config.connectionProxyDictionary?[kCFNetworkProxiesHTTPPort as String] = 8080
let session = URLSession.init(configuration: config)
@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@2KAbhishek
2KAbhishek / Shell_Keybindings.md
Last active April 17, 2024 14:47
Keyboard shortcuts for bash/zsh

Shell Keybindings

Navigation 🚀

Alt + f/b - Move cursor to previous/next word

Ctrl + a/e - Move cursor to beginning/end of command

Ctrl + xx - Toggle between the start of line and current cursor position

@etoxin
etoxin / SSH over USB on a Raspberry Pi.md
Last active March 28, 2024 11:16
SSH over USB on a Raspberry Pi

Our long term goal will be to use SSH over USB. This means that we have to configure Raspbian to treat the USB port like an ethernet port. Mount the micro SD card in a computer (not Pi Zero) and open it with Finder, or Windows Explorer, or whatever it is that you use.

The first thing that you want to do is open a file at the root of the mounted drive called config.txt. In this file you want to add the following line at the very bottom:

dtoverlay=dwc2

The above line will set us up for the next file that we alter. The next file we alter is cmdline.txt, but it is a bit different. Parameters in this file are not delimited by new lines or commas, they are delimited by space characters. In this file we want to add the following: