Skip to content

Instantly share code, notes, and snippets.

View khaliqgant's full-sized avatar
💯
👨🏿‍💻

Khaliq khaliqgant

💯
👨🏿‍💻
View GitHub Profile
@khaliqgant
khaliqgant / interface.ts
Last active March 16, 2022 08:53
[TS Interfaces in Tests] Using Typescript Interfaces In Tests using JSON schema #typescript #tests
/**
*
* Generate Schema
* @desc dynamically create the JSON Schema
* @see https://github.com/YousefED/typescript-json-schema#programmatic-use
* @return {Object} schema
*
*/
function generateSchema (interfaceType: string): Object {
const program = TJS.getProgramFromFiles([resolve('./interfaces/admin/SchemaResponse.ts')], {strictNullChecks: true});
@khaliqgant
khaliqgant / tab.bash
Last active March 16, 2022 08:53 — forked from bobthecow/tab.bash
[Open Terminal Tab From CLI] Open new Terminal tabs from the command line #cli #bash
#!/bin/bash
#
# Open new Terminal tabs from the command line
#
# Original Author: Justin Hileman (http://justinhileman.com)
# Modified By: Khaliq Gant (http://khaliqgant.com)
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc` or `.zshrc`
@khaliqgant
khaliqgant / Slim Listeners, Fat Methods
Last active March 16, 2022 08:54
[Iterate To Create Listeners] Slim Listeners, Fat Methods #jquery
_main.$pushLinks.each(function(){
$(this).on('click', function(e){
_push.clickEvent = true;
var $el = $(this);
_mobile.mobileCheck($el);
_filters.urlAnalyzer('add', $el, false);
return false;
});
});
@khaliqgant
khaliqgant / IFFE Quick Example
Last active March 16, 2022 08:54
[IFFE Example] IFFE Function #javascript
var Gallery = (function() {
// whole lotta code here
})();
@khaliqgant
khaliqgant / multile-watch-tasks.md
Last active March 16, 2022 08:51
[Multiple Watch Tasks] Run Multiple watch tasks with one command in new tabs #javascript #cli
  • Use this tab function as an alias
  • Chain two commands together and enclose each command in quotes. Example:
tab "watchify public/assets/js/sick.js -o public/assets/js/app.js -v" && tab "nodemon server.js"