Skip to content

Instantly share code, notes, and snippets.

View shramee's full-sized avatar
🥳
Coding party

Shramee Srivastav shramee

🥳
Coding party
View GitHub Profile
@shramee
shramee / query-post-meta-table.php
Last active May 3, 2018 16:16
WordPress - Query post meta
<?php
/**
* Query post meta table
*
* @param string|array $name_patt Meta key pattern match
* @param string $query_suffix SQL query suffix
*
* @return array|null Results of query
*/
function shramee_query_post_meta_table( $name_patt, $query_suffix = '' ) {
@shramee
shramee / query-user-meta-table.php
Last active May 3, 2018 16:16
WordPress - Query user meta
<?php
/**
* Query user meta table
*
* @param string|array $name_patt Meta key pattern match
* @param string $query_suffix SQL query suffix
*
* @return array|null Results of query
*/
function shramee_query_user_meta_table( $name_patt, $query_suffix = '' ) {
@shramee
shramee / pure-css-loader.scss
Last active June 23, 2017 06:21
Pure css animated spinning loader
/* SCSS */
@keyframes loader-anim {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.loader {
width: 100px;
height: 100px;
@shramee
shramee / p5-particles.js
Last active March 1, 2017 06:33
Creates random particles with customizable properties
/**
* Created by shramee on 28/02/17.
*/
var particles = {},
particleProps = {},
particleFixOutOfViewport = function ( p, k ) {
var
flipSign = 1,
max = particleProps[ k + 'Max'];
if ( p[k] > max/2 ) { // if particle is in greater half
@shramee
shramee / Gruntfile.js
Last active March 21, 2016 07:02
Gruntfile for using SASS with Grunt and Autoprefixer for a WordPress theme with SASS init `sass/style.scss` directory
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
/* Autoprefixing all css files in theme root */
autoprefixer: {
options : {
browsers : ['last 2 versions'],
},
multiple_files : {