Skip to content

Instantly share code, notes, and snippets.

View squirrel532's full-sized avatar

Squirrel squirrel532

View GitHub Profile
@squirrel532
squirrel532 / SQL Cheat Sheet.md
Created October 13, 2020 09:42 — forked from janikvonrotz/SQL Cheat Sheet.md
SQL Cheat Sheet#SQL#Markdown

SQL languages

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.

DML is short name of Data Manipulation Language which deals with data manipulation, and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.

DCL is short name of Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system.

Datatypes

Text types

@squirrel532
squirrel532 / pre-commit
Created September 20, 2018 07:35 — forked from samhemelryk/pre-commit
A git pre-commit hook example.
#!/bin/bash
#
# This pre-commit hook checks that you havn't left and DONOTCOMMIT tokens in
# your code when you go to commit.
#
# To use this script copy it to .git/hooks/pre-commit and make it executable.
#
# This is provided just as an example of how to use a pre-commit hook to
# catch nasties in your code.
@squirrel532
squirrel532 / git-filter-branch-move-files.md
Created July 24, 2018 17:03 — forked from fabiomaggio/git-filter-branch-move-files.md
Use git filter-branch to move all projects files to a subdir and rewrite all commits
  1. Clone project

  2. Checkout all branches that contain the files that should be moved

  3. Delete the remote

  4. Run the filter-branch command:

    git filter-branch --tree-filter 'mkdir -p /path/to/tmp; mv * /path/to/tmp; mkdir subdir; mv /path/to/tmp/* subdir/' --tag-name-filter cat --prune-empty -- --all
    • All files are first copied to a temporary dir and move from there to the new destination
  • Existing tags are updated
@squirrel532
squirrel532 / General Makefile
Created May 22, 2017 15:57 — forked from reecer/General Makefile
A general makefile for general-purpose C projects.
CC=gcc
CCFLAGS=-Wall
LDFLAGS=
SOURCES=$(wildcard *.c)
OBJECTS=$(SOURCES:.c=.o)
TARGET=des
all: $(TARGET)
$(TARGET): $(OBJECTS)
@squirrel532
squirrel532 / ptt.sh
Last active February 29, 2016 08:52
#!/bin/bash
# tty_pipe=$(tty)
# echo "\$tty_pipe = $tty_pipe"
[ -z "$USER" ] && echo -ne "User: " && read USER
[ -z "$PASS" ] && echo -ne "Password: " && read -s PASS
function autoptt()
{