Skip to content

Instantly share code, notes, and snippets.

Avatar

Surjith S M surjithctly

View GitHub Profile
View jsx-cheatsheet.jsx
/**
I always forgot these simple JSX methods.
So I can refer this anytime.
Surjith S M / @surjithctly
**/
//---------------------------------------------------------------------
// Javascript map Function
{props.items.map((item) => {
@surjithctly
surjithctly / js-cheatsheet.js
Last active Mar 5, 2021
Vanilla JavaScript Cheat Sheet
View js-cheatsheet.js
/**
I always forgot these simple javascript methods.
So I can refer this anytime.
Surjith S M / @surjithctly
**/
//---------------------------------------------------------------------
// Javascript get element by ID
@surjithctly
surjithctly / .eleventy.js
Created Sep 29, 2020
Eleventy markdown Plugin
View .eleventy.js
module.exports = function (eleventyConfig) {
/* Markdown Plugins */
let markdownIt = require("markdown-it");
let markdownItAnchor = require("markdown-it-anchor");
let options = {
html: true,
breaks: true,
linkify: true,
};
let opts = {
@surjithctly
surjithctly / mission_control_ext_bkp.json
Created May 23, 2020
Mission Control Chrome Extension Backup Data
View mission_control_ext_bkp.json
{
"sites": [
{
"cid": "11c42dd7dbede6948adbc02b",
"date": 1590162379659,
"id": 1,
"label": "Icons",
"starred": false,
"websites": [
{
@surjithctly
surjithctly / mission_control_ext_bkp.json
Last active May 23, 2020
Mission Control Chrome Extension Backup Data
View mission_control_ext_bkp.json
{
"sites": [
{
"cid": "11c42dd7dbede6948adbc02b",
"date": 1590162379659,
"id": 1,
"label": "Icons",
"starred": false,
"websites": [
{
@surjithctly
surjithctly / hello_world.py
Created May 20, 2020
Hello World Examples
View hello_world.py
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
@surjithctly
surjithctly / hello_world.rb
Created May 18, 2020
Hello World Examples
View hello_world.rb
class HelloWorld
def initialize(name)
@name = name.capitalize
end
def sayHi
puts "Hello !"
end
end
hello = HelloWorld.new("World")
View vscode-shortcuts.md
Shortcuts Description
Shift+Alt+Right Select contents of currently selected tag
Ctrl+Shift+ [ or ] Fold / Unfold Code region
@surjithctly
surjithctly / script.js
Created Jul 21, 2017
jQuery - Run only if Plugin Exists and the Element is found. Else Skip
View script.js
// Cache class name
var $element = $('.element');
if ($element.length && $.fn.functionname) {
// Do awesome Stuff
}
View smoothscroll.js
/* SmoothScroll for websites v1.2.1. Licensed under the terms of the MIT license.
People involved: Balazs Galambosi (maintainer), Michael Herf (Pulse Algorithm), Edwin Ang (optimzation and added support) */
(function() {
var defaultOptions = {
frameRate: 150,
animationTime: 750,
stepSize: 120,
pulseAlgorithm: true,
pulseScale: 8,
pulseNormalize: 1,