Skip to content

Instantly share code, notes, and snippets.

View swashata's full-sized avatar
🏡
Working from home

Swashata Ghosh swashata

🏡
Working from home
View GitHub Profile
@rviscomi
rviscomi / lorem-ipsum.js
Created December 15, 2011 03:06
JavaScript Lorem Ipsum Generator
/**
* @fileOverview Generates "Lorem ipsum" style text.
* @author rviscomi@gmail.com Rick Viscomi,
* tinsley@tinsology.net Mathew Tinsley
* @version 1.0
*/
/**
* Copyright (c) 2009, Mathew Tinsley (tinsley@tinsology.net)
* All rights reserved.
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active April 17, 2024 12:35
Using Git with Subversion Mirroring for WordPress Plugin Development
@idleberg
idleberg / fish_shell.md
Last active March 27, 2024 22:37
Instructions on how to install Fish shell on Mac OS X, including Oh My Fish!. Also includes several useful functions.

Installation

  1. Install fish via Brew
  2. Optionally install Oh My Fish!
  3. Add fish to known shells
  4. Set default shell to fish
brew install fish  
curl -L https://get.oh-my.fish | fish
@robballou
robballou / someModule.js
Created October 29, 2014 23:04
Testing jQuery code in Mocha
// The hacky bit of this approach is that this module uses
// jQuery, but it is not referenced here. This is because I
// am populating it in the test via global namespace.
//
// In the browser this still works because I am adding jQuery
// via a Browserify transform (browserify-global-shim).
function someModule() {
}
modules.export = someModule;
@yesvods
yesvods / gist:51af798dd1e7058625f4
Created August 15, 2015 11:13
Merge Arrays in one with ES6 Array spread
const arr1 = [1,2,3]
const arr2 = [4,5,6]
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6]
@martarf
martarf / wp-unit-test.md
Last active June 15, 2017 11:44
Wordpress Plugin Unit Tests

WP PLUGIN UNIT TEST

You will need svn, PHPUnit and wp-cli (they are provided by VVV). Make sure you have them installed.

###1. Set up

Initialize your testing environment using install-wp-tests.sh script.This script installs a copy of Wordpress in the /tmp directory (by default) as well as the Wordpress unit testing tools. Then it creates the specified database to be used while running tests.

@jonsuh
jonsuh / .bash_profile
Last active February 16, 2024 17:17
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'

Cheatsheet

Move cursor

command description
ctrl+a Move cursor to the start of the line
ctrl+e Move cursor to the end of the line
or ctrl+b Move cursor back one character
▶ or ctrl+f Move cursor forward one character
@Narayon
Narayon / config_mac.md
Created March 6, 2017 02:58
Config MacOs machine

macOS

Custom recipe to get macOS running from scratch, setup applications and (WordPress) developer environment. I use this gist to keep the steps required to have a functioning system after a semi-annual fresh install.

Software

Browsers

System

@samthor
samthor / safari-nomodule.js
Last active February 14, 2024 02:54
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.: