This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This Gist is a list of resources and commands to accompany The Hackershack YouTube series. | |
# For this attempt I am using Linux / Ubuntu and the demo is on a mac, so I will note any differences as I go along | |
# BASICS (E01) | |
# https://www.youtube.com/watch?v=rA4X73E_HV0 | |
# How to install ZSH on Ubuntu: | |
# https://www.redswitches.com/blog/install-zsh-#ubuntu/#:~:text=Zsh%2C%20or%20Z%20Shell%2C%20is,commands%2C%20and%20improved%20customization%20options. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Containers | |
# Show running containers | |
docker ps | |
# Show all containers | |
docker ps --all | |
docker ps -a | |
# Show all container ids | |
docker ps -q | |
# Create a container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compare branches | |
# Show name of files only | |
git diff [branch1] [branch2] --name-only | |
# Merge branches | |
# Merge with no auto commit | |
git merge [branch] --no-commit --no-ff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "\n*** CSV Scrub ***\n"; // Message console | |
$csvFile = $argv[1]; // Define $csvFile from Konsole argument | |
/* File */ | |
if (empty($csvFile)) { //Throw error if $csvFile not defined | |
echo "\n*** ERROR: Filename not specified ***\n"; // Message console | |
die(); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('xdebug.var_display_max_depth', -1); | |
ini_set('xdebug.var_display_max_children', -1); | |
ini_set('xdebug.var_display_max_data', -1); | |
/** | |
* This code sample illustrates how to use BatchJobService to create a complete | |
* campaign, including ad groups and keywords. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
array (size=4) | |
0 => | |
array (size=2) | |
'screen_id' => string 'A0E6457F-EF4F-4BEF-811A-0ACE00AE6225' (length=36) | |
'name' => string 'Level 1 - Stalls' (length=16) | |
1 => | |
array (size=2) | |
'screen_id' => string 'A34D24F8-B1C5-4E26-A1FE-91A3C13A4F10' (length=36) | |
'name' => string 'Level 2 - Dress Circle' (length=22) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE [table] SET url = REPLACE (url, 'a', 'b') WHERE [column] LIKE '%alan%'; | |
-- Produces 'blbn' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE table AS t | |
SET t.id = ''; | |
SET @rank:=0; | |
update table AS t | |
set t.id =@rank:=@rank+1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump -u [user] -p[password] database_name table_name > destination/backup_file.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AND (SUBSTRING_INDEX(SUBSTR(email, INSTR(email, '@') + 1),'.',1)) IN('yahoo', 'ymail', 'bt', 'rocketmail', 'msn', 'live', 'hotmail') |
NewerOlder