Skip to content

Instantly share code, notes, and snippets.

View vajahath's full-sized avatar
👨‍🚀
Distorting spacetime continuum

Vajahath Ahmed vajahath

👨‍🚀
Distorting spacetime continuum
View GitHub Profile
@vajahath
vajahath / method-decorator-example.ts
Created August 13, 2019 09:41
typescript decorator example
// function decorator example
function keepTrack() {
// stores(or tracks) input and output
const track: [any, any][] = [];
return {
tracker: <MethodDecorator>(
function(target, prop, descriptor: PropertyDescriptor) {
const method = descriptor.value;

successful-operation polymer custom element

A UI element that can be used to indicate that the operation was successful.

(version: 1.0.5.)

Just use

<successful-operation></successful-operation>

to show up the above element.

Here is how to get started

visit npm package

Setup Polymer

You need Polymer base files to use this component.

  1. Install Bower if you don't have : sudo npm install -g bower.
  2. Download Polymer using bower: bower install Polymer/polymer.
@vajahath
vajahath / npmQTest.js
Created April 24, 2016 15:09
Node promise example with then() using npm q module
// require q lib
var q = require('q');
// function deininitions
function sayone(){
var d = q.defer();
// function that takes time to finish
setTimeout(function(){
console.log("sayone is called");
wget https://download.sublimetext.com/sublime_text_3_build_3103_x64.tar.bz2
tar xjf sublime_text_3_build_3103_x64.tar.bz2
./configure
make
sudo make install
@vajahath
vajahath / Package Control.sublime-settings
Created March 3, 2016 02:21
package Control.sublime-settings
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"1337 Color Scheme",
"All Autocomplete",
"AngularJS",
@vajahath
vajahath / settings-user
Last active March 3, 2016 02:18
mySublime settings-user
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/1337 (SL).tmTheme",
"font_size": 15,
"ignored_packages":
[
"Arduino-like IDE",
"CSSComb",
"jQuery",
@vajahath
vajahath / gist:e9ec0b6c530b07269465
Created March 2, 2016 02:19 — forked from kitek/gist:1579117
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");
@vajahath
vajahath / js-code-reuse.js
Last active February 27, 2016 07:22
reusable js code and reference
/**
* @file Javascript Code Reference
* @author vajuoff.1@gmail.com
*/
// create model file for mongoose model
// =========================================BEGIN
/**
* @file Describes the 'user' model for generating mongoose schema.
* @author Vajahath
@vajahath
vajahath / index.ejs
Created February 25, 2016 15:25
jquery > post an object. Stringification is important!
$.ajax({
type: 'POST',
url: 'http://localhost:3000/auth/google/authCodeHandler',
contentType: 'application/json; charset=utf-8',
success: function (result) {
// Handle or verify the server response.
console.log(result);
},
processData: false,
data: JSON.stringify({code: authResult['code']})