Skip to content

Instantly share code, notes, and snippets.

View AhsanAyaz's full-sized avatar

Muhammad Ahsan Ayaz AhsanAyaz

View GitHub Profile
@AhsanAyaz
AhsanAyaz / camelcase_pascal_to_underscore.js
Created May 29, 2017 11:56
A simple Javascript snippet to convert any camelCase or PascalCase string to underscore (or custom joiners)
var testStrSimple = "MyNameIsAhsanAyaz";
var testStrWhiteSpace = "myName \nIsAhsan";
console.log(ccpc2und(testStrSimple));
console.log(ccpc2und(testStrWhiteSpace));
console.log(ccpc2und(testStrWhiteSpace, "__:D__")); // custum joiner
// using LONG METHOD (for no reason)
console.log(_ccpc2und(testStrSimple));
@AhsanAyaz
AhsanAyaz / js-f.js
Created August 14, 2017 17:28
A hidden message/ crucial info
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+
@AhsanAyaz
AhsanAyaz / angular-travis-ci.yml
Last active January 3, 2020 00:20
Sample TravisCI Yaml file for Angular Project
language: node_js
node_js:
- "7"
sudo: true
dist: trusty
branches:
only:
- master
import { Pro } from '@ionic/pro';
import { Injectable, ErrorHandler, Injector } from '@angular/core';
import { IonicErrorHandler } from 'ionic-angular';
// initializing the Ionic Pro client
const IonicPro = Pro.init('APP_ID', {
appVersion: "APP_VERSION"
});
@Injectable()
import { Pro } from '@ionic/pro';
import { Injectable, ErrorHandler, Injector } from '@angular/core';
import { IonicErrorHandler } from 'ionic-angular';
// initializing the Ionic Pro client
const IonicPro = Pro.init('APP_ID', {
appVersion: "APP_VERSION"
});
@Injectable()
...
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { AppErrorHandlerProvider } from '../providers/app-error-handler/app-error-handler';
...
@NgModule({
...,
providers: [
...,
{ provide: ErrorHandler, useClass: AppErrorHandlerProvider }
@AhsanAyaz
AhsanAyaz / stop-watch.tsx
Created February 25, 2018 09:17
Stop Watch Component built with Stencil
import { Component, Prop } from "@stencil/core";
@Component({
tag: "stop-watch",
styleUrl: "stop-watch.css"
})
export class StopWatchComponent {
@Prop() hours: string;
@Prop() minutes: string;
@Prop() seconds: string;
@AhsanAyaz
AhsanAyaz / stop-watch.css
Created February 25, 2018 09:18
Stop Watch Component (built with Stencil) styles
.watch-wrapper {
background: #2196F3;
padding: 20px;
display: block;
font-family: monospace;
box-shadow: 0 16px 16px 0 rgba(0,0,0,0.1);
}
.watch{
display: flex;
@AhsanAyaz
AhsanAyaz / stop-watch-box.tsx
Created February 25, 2018 09:27
Stop Watch Box Component built with Stencil
import { Component, State } from "@stencil/core";
import { WatchService } from "../../services/watch-service";
@Component({
tag: "stop-watch-box",
styleUrl: "stop-watch-box.css"
})
export class StopWatchBoxComponent {
private hh = 0;
private mm = 0;
@AhsanAyaz
AhsanAyaz / stop-watch-box.css
Created February 25, 2018 09:32
Styles for Stop Watch Box Component built with Stencil
.watch-box {
display: block;
height: 300px;
width: 300px;
margin: 0 auto;
padding-top: 20px;
}
.watch-box .watch-container {
padding: 20px;