Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing on Angular search project for WordPress blog

Kushal Jayswal kutec

View GitHub Profile
@kutec
kutec / _spacing-helpers.scss
Created Feb 6, 2018 — forked from jacurtis/_spacing-helpers.scss
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
View _spacing-helpers.scss
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@kutec
kutec / bootstrap-breakpoints.sass
Created Jan 9, 2018 — forked from webinfinita/bootstrap-breakpoints.sass
Variables for responsive design in bootstrap with sass
View bootstrap-breakpoints.sass
@mixin breakpoint($point)
@if $point == lg
@media (min-width: 1200px)
@content
@else if $point == md
@media (min-width: 992px) and (max-width: 1199px)
@content
@else if $point == sm
@kutec
kutec / form.html
Created Oct 3, 2017 — forked from runspired/form.html
How to turn off password and email/username autocomplete.
View form.html
<!--
<form autocomplete="off"> will turn off autocomplete for the form in most browsers
except for username/email/password fields
-->
<form autocomplete="off">
<!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields -->
<input id="username" style="display:none" type="text" name="fakeusernameremembered">
<input id="password" style="display:none" type="password" name="fakepasswordremembered">
@kutec
kutec / angular-2-cloud-9.md
Created Jul 6, 2017 — forked from IamAdamJowett/angular-2-cloud-9.md
Running Angular 2 and Angular 4 on Cloud9
View angular-2-cloud-9.md

##Angular CLI (ng serve)

To run the standard angular-cli ng serve on a Cloud9 box, you need to specify the cloud9 specific ports the preview runs off as well as define a live preview port. So instead of the angular-cli command of ng serve, run the following:

ng serve --host 0.0.0.0 --port 8080 --live-reload-port 8081

The port configuration is the important part to make sure it is accessible to preview. Once running, preview the App as per usual in Cloud9 via the "Preview" button (no need to use the "Run" button).

To make things easier, you can assign that command to an alias:

View isotope-centered-masonry-and-masonry-gutters.js
$(function() {
// Tweaked from: https://gist.github.com/mattstauffer/3835881
// No guarantees
// 1. include Isotope.js
// 2. include this file
// 3. customize Isotope options at the bottom of this file
// 4. add "margin: 0 auto" to the isotope container
$.Isotope.prototype._getMasonryGutterColumns = function() {
View AngularPortletFriendlyURLMapper.java
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
View CfWS-2.js
var http = require('http');
var requesrHandler = function(req, res){
res.writeHead(200, {
'content-Type': 'text/plain'
});
res.end('Welcome...');
};
var server = http.createServer(requesrHandler);
@kutec
kutec / detect-private-browsing.js
Created Apr 29, 2016 — forked from cou929/detect-private-browsing.js
Detect private browsing mode (InPrivate Browsing or Incognito).
View detect-private-browsing.js
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
@kutec
kutec / SassMeister-input-HTML.html
Created Dec 16, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="adhoc">
<d
</div>
You can’t perform that action at this time.