Skip to content

Instantly share code, notes, and snippets.

View cogentParadigm's full-sized avatar

Ali Gangji cogentParadigm

View GitHub Profile
@webdevel
webdevel / vim-cheat-sheet.md
Last active March 9, 2025 17:22
Vim Cheat Sheet

Vim Cheat Sheet

Vim is an advanced CLI based text editor. Many key combinations used in Vim are easily associated with a memorable phrase. One effective way to use Vim is to associate phrases with Operators, Text Objects and Motions. Then compose a phrase for what you want to do. Start with an Operator followed by a Text Object or Motion. Prefix an Operator, Command or Motion with a number/count to extend it.

Table of Contents
@Tyriar
Tyriar / random_from_list.sql
Created July 17, 2014 13:18
Various T-SQL database obfuscation scripts
-- randomise a column's values using a list of specified values
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ShuffleTable')
DROP TABLE [ShuffleTable];
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'InsertDataListTable')
DROP TABLE [InsertDataListTable];
GO
CREATE TABLE [InsertDataListTable] ([TargetColumn] NVARCHAR(50));
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@mnapoli
mnapoli / behat-reference.feature
Last active February 12, 2024 10:54
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
@aderowbotham
aderowbotham / purge-ban-domain-varnish.md
Last active August 3, 2024 17:33
Purge (ban) an entire domain in Varnish Cache 3

How to purge ('ban') an entire domain in Varnish Cache 3

#####EDIT: NB Ban is technically different from Purge. Banned objects remain in memory but banning is faster than purging. Read the Varnish 3 documentation here and here.

Purge may be a more appropriate action for your use-case; although the examples in the gist below work, it's not necessarily the best way of doing this.