Skip to content

Instantly share code, notes, and snippets.

View NisugaJ's full-sized avatar
🎯
Focusing

Nisuga Jayawardana NisugaJ

🎯
Focusing
View GitHub Profile
@NisugaJ
NisugaJ / outsideClick.ts
Created February 26, 2024 21:10
Detect a mouse click event outside of a given node
/**
* Detect outside clicks
* @param node - The node to detect outside clicks. The callback will be executed when outside of this node click is detected
* @param callback - The callback to execute when an outside click is detected
* @param excludes - The ids of the nodes to exclude from the outside click detection
*/
export function outsideClick(
node: Node,
@NisugaJ
NisugaJ / gulpfile.js
Created November 6, 2023 21:00 — forked from martincarlin87/gulpfile.js
Example gulpfile for PHP, SASS, Watching, Minifying, Optimising, Live Reload and Deploying
var gulp = require('gulp');
var gutil = require('gulp-util');
var argv = require('minimist')(process.argv);
var prompt = require('gulp-prompt');
var rsync = require('gulp-rsync');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require('browser-sync');
var useref = require('gulp-useref');
<Configuration status="debug" name="your-project" packages="">
<Appenders>
<!-- Console logging -->
<Console name="stdout" target="SYSTEM_OUT">
<!-- Console logging pattern -->
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %p %m%n"/>
</Console>
<!-- Rolling file logging with a new folder for each new month -->
@NisugaJ
NisugaJ / ffmpeg.md
Created April 29, 2021 08:31 — forked from protrolium/ffmpeg.md
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@NisugaJ
NisugaJ / active_record.md
Created March 11, 2020 07:57 — forked from yesnik/active_record.md
Yii 1 Framework Cookbook

CActiveRecord methods

findAll()

Sort records

// Ascending order
Partner::model()->findAll(array('order' => 'company'));