Skip to content

Instantly share code, notes, and snippets.

View madhawa-se's full-sized avatar
😃
hmm

madhawa priyashantha madhawa-se

😃
hmm
  • mad-logic
  • srilanka
View GitHub Profile
import cv2
import numpy as np
import imutils
def nothing(x):
pass
# Load an image
img = cv2.imread('ellipse.jpg')
@nrobinaubertin
nrobinaubertin / app.component.ts
Created January 17, 2017 13:36
Exemple of ngb-date-parser-formatter implementation (ng-bootstrap)
import { NgbDatepickerConfig, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
import { NgbDateFRParserFormatter } from "./ngb-date-fr-parser-formatter"
@Component({
providers: [{provide: NgbDateParserFormatter, useClass: NgbDateFRParserFormatter}]
})
export class AppComponent {}
/*
EXAMPLE:
input.messy_data_from_previous_trigger_or_action = 'This is a single string of text that contains lots of different data. {"name": "John"} Sometimes when you are building a Zap, you will need to pull out one piece of data from a long, messy string of text. {"email": "[email protected]"} Thankfully, you can use the "Formatter by Zapier" app or the "Code by Zapier" app to extract the information you need.'
*/
function extract_piece_of_data(entire_string_of_text, characters_before_desired_data, characters_after_desired_data) {
var desired_data_with_stuff_after_it = entire_string_of_text.substr(entire_string_of_text.indexOf(characters_before_desired_data) + characters_before_desired_data.length);
@lopspower
lopspower / README.md
Last active August 12, 2025 07:46
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@KhanMaytok
KhanMaytok / particle-sphere.js
Created December 8, 2015 23:38
Create a sphere made of particles with Three.js
var distance = 100;
var geometry = new THREE.Geometry();
for (var i = 0; i < 1000; i++) {
var vertex = new THREE.Vector3();
var theta = THREE.Math.randFloatSpread(360);
var phi = THREE.Math.randFloatSpread(360);
@seripap
seripap / months.js
Created October 8, 2015 21:32 — forked from bgadrian/months.js
JavaScript JS month names arrays
var month= ["January","February","March","April","May","June","July",
"August","September","October","November","December"];
var month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul","Aug", "Sep", "Oct", "Nov", "Dec"];
//used with date.getMonth()
@PurpleBooth
PurpleBooth / README-Template.md
Last active August 12, 2025 15:46
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ldong
ldong / download_egghead_videos.md
Last active December 7, 2023 16:16
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
@Noitidart
Noitidart / _ff-addon-snippet-WinAPI_SendMessage.js
Last active August 29, 2015 14:11
_ff-addon-snippet-WinAPI_SendMessage - How to use SendMessage. [jsctypes] [winapi]
Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/ctypes.jsm');
if (ctypes.voidptr_t.size == 4 /* 32-bit */ ) {
var is64bit = false;
} else if (ctypes.voidptr_t.size == 8 /* 64-bit */ ) {
var is64bit = true;
} else {
throw new Error('huh??? not 32 or 64 bit?!?!');
}
@hilukasz
hilukasz / Selected_layers-PS.jsx
Last active January 3, 2025 21:07
get array of selected layers in photoshop via extendscript
var docRef = app.activeDocument;
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
function newGroupFromLayers(doc) {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putClass( sTID('layerSection') );