Skip to content

Instantly share code, notes, and snippets.

@marawannwh
marawannwh / quickgit.fish
Created December 4, 2024 02:58 — forked from Abushawish/quickgit.fish
Git add, commit, and push in one function for Fish Shell
# How to git add, commit, and push using one function in friendly interactive shell (Fish Shell).
# Save this file within '~/.config/fish/functions' as 'quickgit.fish'. Create the directory if it does not exist.
# '--git-dir=$PWD/.git' Ensures that we run the git commands against the git project where we called the function
function quickgit # This is the function name and command we call
git --git-dir=$PWD/.git add . # Stage all unstaged files
git --git-dir=$PWD/.git commit -a -m $argv # Commit files with the given argument as the commit message
git --git-dir=$PWD/.git push # Push to remote
end
@marawannwh
marawannwh / git-aware-bash-prompt.md
Created September 3, 2019 23:42 — forked from eliotsykes/git-aware-bash-prompt.md
Git Aware Bash Prompt
@marawannwh
marawannwh / GitForWindowsSetup.md
Created February 28, 2019 13:31 — forked from dmangiarelli/GitForWindowsSetup.md
How to setup SSH with Git for Windows

How to setup Git for Windows

I know this document seems long, but it shouldn't be too difficult to follow. This guide is based on Windows, but every program here has Linux/Mac equivalents, and in most cases they're built-in. So, take a deep breath and go step by step.

The steps below are for GitHub, but the steps are almost idential for Bitbucket, Heroku, etc.

You'll probably want to make sure Chocolatey is installed, since it streamlines installing this stuff later. If you install via Chocolatey, you don't need to run the installers from the products' respective sites.

Cmder / ConEmu

@marawannwh
marawannwh / ruby language
Created December 18, 2016 19:18 — forked from patriques82/ruby language
A summary of the book "The Ruby Programming Language" by David Flanagana and Yukihiro "Matz" Matsumoto
CONTENT
Expressions, Statements and Controlstructures
Equlaity
Assigments
The ||= idiom
Other assignments
Flip-flops
Iterators
Blocks
Control-flow keywords
@marawannwh
marawannwh / readability.rb
Last active August 29, 2015 14:26 — forked from emad-elsaid/readability.rb
import links content to facebook comments by mentioning this bot, you'll need to run it periodically using cronjob
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
# **Usage** :
#
# * `ruby readability.rb <accesstoken>`
# this will get a long term access token from the short term one
# you can create a facebook app and get access token from here
# * `ruby readability.rb`
# will start the script
require 'open-uri'

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
import java.util.Scanner;
public class ipreader {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("enter your ip");
String ip=s.next();
String newip="";
char ipChar;
for(int i=0;i<ip.length();i++)