Skip to content

Instantly share code, notes, and snippets.

View vikrantnegi's full-sized avatar
Focusing

Vikrant Negi vikrantnegi

Focusing
View GitHub Profile
@vikrantnegi
vikrantnegi / App.js
Created January 17, 2019 10:10 — forked from rgazeredo/App.js
import React, { Component } from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
import RNLanguages from 'react-native-languages';
import i18n from 'i18n-js';
import en from './translations/en.json';
import fr from './translations/fr.json';
import de from './translations/de.json';
type Props = {};
react-native init location-tracking
@vikrantnegi
vikrantnegi / main.js
Created September 25, 2017 07:51
Bootstrap dropdown list position (Up/Bottom) based on document height
function determineDropDirection(){
$(".dropdown-menu").each( function(){
// Invisibly expand the dropdown menu so its true height can be calculated
$(this).css({
visibility: "hidden",
display: "block"
});
// Necessary to remove class each time so we don't unwantedly use dropup's offset top
@vikrantnegi
vikrantnegi / category.php
Last active September 23, 2017 16:26
CPT Custom category
<?php if (have_posts()) : while (have_posts()) : the_post(); $post_type = get_post_type( get_the_ID() );
if ($post_type == 'case_study') ?>
<div class="col-sm-4 col-xs-12">
<a href="<?php the_permalink(); ?>" class="gallery-box">
<figure>
<?php the_post_thumbnail('medium', array('class' => 'gallery__img')); ?>
<figcaption class="gallery__caption">
<div class="gallery__caption-in">
<h3 class="gallery__tag"><?php the_title(); ?></h3>
@vikrantnegi
vikrantnegi / SCSS.md
Created July 18, 2017 05:26 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@vikrantnegi
vikrantnegi / 0_reuse_code.js
Created December 21, 2016 07:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vikrantnegi
vikrantnegi / mac-voshts.md
Created December 15, 2016 10:20
Mac vhosts
sudo nano /etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
    ServerName example.dev
    ServerAlias www.example.dev
 
@vikrantnegi
vikrantnegi / new-tab-link.html
Last active February 24, 2017 05:13
LInk In New Tab
@vikrantnegi
vikrantnegi / google-maps.json
Created October 24, 2016 13:17
google map custom styles
[
{
"featureType": "administrative",
"elementType": "all",
"stylers": [
{
"visibility": "off"
}
]
},
@vikrantnegi
vikrantnegi / sr-text.css
Last active October 22, 2016 14:44
Visually hide some text while keeping it accessible
/* For only text */
.sr-only {
border: 0 !important;
clip: rect(1px, 1px, 1px, 1px) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;