Skip to content

Instantly share code, notes, and snippets.

@Nikeshsuwal
Nikeshsuwal / _mixins.scss
Last active August 26, 2015 12:42 — forked from garyharan/_mixins.scss
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@Nikeshsuwal
Nikeshsuwal / index.slim
Last active December 22, 2015 05:48
Custom style to upload file
form
.form-group.image-upload
label for="society_image"
span
| Upload Society Picture
i.fa.fa-cloud-upload
.file_name
= f.file_field :image, placeholder: "Upload Society Picture",class: 'form-control input-lg inputfile'
@Nikeshsuwal
Nikeshsuwal / index.slim
Last active December 14, 2015 05:15
Use fontawesome icon as background image
form
.form-group
.image-upload
label for="society_image" class="input-lg"
span
| Upload Society Picture
= f.file_field :image, placeholder: "Upload Society Picture",class: 'form-control input-lg inputfile'
@Nikeshsuwal
Nikeshsuwal / index.slim
Last active December 14, 2015 05:25
Make custom dropdown select design
.styled-select
select#society_scope name="society[scope]"
option value="" What is the scope of this society ?
option value="area" area
option value="neighbourhood" neighbourhood
option value="state" state
option value="country" country
option value="world" world
@Nikeshsuwal
Nikeshsuwal / html.html
Created December 24, 2015 11:27
How to keep footers at the bottom of the page
<div id="container">
<div id="header"></div>
<div id="body"></div>
<div id="footer"></div>
</div>
@Nikeshsuwal
Nikeshsuwal / youtube_download.txt
Last active February 24, 2016 04:52
Install youtube-dl and ffmpeg
Open terminal adn then running command below :
youtube-dl youtube-url --extract-audio --audio-format mp3
To convert a YouTube video to mp3, runing this command on terminal:
youtube-dl youtube-url --extract-audio --audio-format mp3
Example:
youtube-dl http://www.youtube.com/watch?v=QGJuMBdaqIw --extract-audio --audio-format mp3
@Nikeshsuwal
Nikeshsuwal / control.js
Last active March 9, 2016 04:25
up/down page section
$(document).ready(function () {
//Move Next section
var $sec = $("section");
$(".arrow-down ").click(function(){
var y = $sec.filter(function(i, el) {
return el.getBoundingClientRect().bottom > 100;
})[$(this).hasClass("arrow-down")?"next":""]("section").offset().top;
$("html, body").stop().animate({scrollTop: y});
});
@Nikeshsuwal
Nikeshsuwal / scroll.js
Last active March 24, 2016 09:43
fixed content in certain position after scrolling
$(window).scroll(function(){
header_height = $('.inner_header-bg').height(); //header height
content_height = $('.joinus-home').offset().top; //content height
window_scroll = $(window).scrollTop(); //scrolling value
header_footer_height= 554+115 //total height of header and footer
pos = content_height - header_footer_height;
filter_col = $('.item_filter').parent().width();
if ( pos > window_scroll) {
$('.item_filter').css({
'position': 'fixed',