Skip to content

Instantly share code, notes, and snippets.

View kutec's full-sized avatar
🎯
Love Coding <3

Kushal Jayswal kutec

🎯
Love Coding <3
View GitHub Profile
@jacurtis
jacurtis / _spacing-helpers.scss
Last active April 15, 2024 12:05
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
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
@mjbradford89
mjbradford89 / AngularPortletFriendlyURLMapper.java
Last active March 28, 2022 11:37
Angular2 in Liferay Portal 7
/**
* 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
// No media query since this is the default in Bootstrap
// Very small devices (tablets, 480px and up)
@media (min-width: $screen-xs-min) {
}
// Small devices (tablets, 768px and up)
@media (min-width: $screen-sm-min) {
@runspired
runspired / form.html
Created May 23, 2016 13:46
How to turn off password and email/username autocomplete.
<!--
<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">
// Require nodes http module
var http = require('http');
// Require a third party mysql module (use "npm install mysql" to install it)
var mysql = require('mysql');
// Create a connection pool
var pool = mysql.createPool({
host: 'localhost',
user: 'username',
<?php
// Connect to mySQL (*blocking*)
$link = mysqli_connect("localhost", "user", "password", "test");
// Run a query and store result object (*blocking*)
if($result = mysqli_query($link, "SELECT * FROM Person")) {
// Fetch data from phps internal buffer into $data
$data = mysqli_fetch_all($result);
@Restuta
Restuta / howto-put-git-repo-into-another-repo.md
Last active April 22, 2021 16:43
How to make git repo to be another's repo subfolder preserving history

Hacky way (let me know if you know better one)

Let's say you have repo Main and repo Proto, you want to put your Proto under Main, so folder structure will be the following:

|-SRC
   |---proto

and you also want to preserve commit history, so everybody can see what you were doing while developing proto, sounds like pretty easy task. The easiest way is to create folder structure similar to Main repo SRC\proto and start working using is as a root, but if you like me, you didn't think about this beforehand, so you path would be harder:

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@webinfinita
webinfinita / bootstrap-breakpoints.sass
Last active February 27, 2024 17:23
Variables for responsive design in bootstrap with 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