Skip to content

Instantly share code, notes, and snippets.

View shash7's full-sized avatar

Shashwat amin shash7

View GitHub Profile
-- Weigh rows against eachother based on different conditions,
-- ordering the results based on their given weights so that
-- more precise matches will show higher up in the results.
-- In this example, an exact match will show up at the top
-- of the results, a match at the beginning of the string
-- will show next, and a match anywhere will show last.
set @query = 'Liam';
@linlymatsumura
linlymatsumura / _smooth gradient.scss
Created April 23, 2018 16:00
this is smooth gradient mixin for sass.
@mixin smooth-gradient($direction, $from, $to) {
background-color: $to;
background-image: linear-gradient($direction,
rgba($from, 1) 0%,
rgba($from, 0.738) 19%,
rgba($from, 0.541) 34%,
rgba($from, 0.382) 47%,
rgba($from, 0.278) 56.5%,
rgba($from, 0.194) 65%,
rgba($from, 0.126) 73%,
@CannonballSkippy
CannonballSkippy / test.html
Created May 17, 2017 21:33
Basic markup test content for typography
<h1>Testing display of HTML elements</h1>
<h2>This is 2nd level heading</h2>
<p>This is a test paragraph.</p>
<h3>This is 3rd level heading</h3>
<p>This is a test paragraph.</p>
<h4>This is 4th level heading</h4>
<p>This is a test paragraph.</p>
<h5>This is 5th level heading</h5>
<p>This is a test paragraph.</p>
@AustinGil
AustinGil / functions.php
Last active September 14, 2020 11:56
JSON-LD for WordPress posts
/**
* Remove hentry from post_class
* This is important to not get schema errors
*/
function visceral_remove_hentry_class( $classes ) {
$classes = array_diff( $classes, array( 'hentry' ) );
return $classes;
}
add_filter( 'post_class', 'visceral_remove_hentry_class' );
@blindsey
blindsey / github_post_commit.js
Created August 27, 2011 06:17
node.js auto deploy scripts
Steps:
0. Checkout your git repo from the server (I use /var/www/carbonite)
1. Upload both of these files to the same directory on your server
2. chmod +x restart_node.sh
3. nohup node github_post_commit.js 2>&1 >> github_post_commit.log &
4. In the github admin for your repo, set a post commit hook to the url http://<your host>:8080/
5. Make a commit to your repo
6. Point a browser at http://<your host>:8080/ and you should see the commit