Skip to content

Instantly share code, notes, and snippets.

View Harshit369's full-sized avatar
๐Ÿ’ป
Committing out there if not here.

Harshit Thukral Harshit369

๐Ÿ’ป
Committing out there if not here.
View GitHub Profile
@Harshit369
Harshit369 / play_pause_youtube
Created September 7, 2018 06:37 — forked from willhoney7/play_pause_youtube
play/pause youtube via applescript
tell application "Google Chrome"
set found_video to false
set window_list to every window
repeat with the_window in window_list
if found_video is equal to true then
exit repeat
end if
set tab_list to every tab in the_window
repeat with the_tab in tab_list
if the title of the_tab contains "- YouTube" then
@Harshit369
Harshit369 / mobxLogger.js
Created August 17, 2018 12:58 — forked from mmazzarolo/mobxLogger.js
While waiting for React-Native MobX devtools...
import mobx from 'mobx'
const DEFAULT_STYLE = 'color: #006d92; font-weight:bold;'
// Just call this function after MobX initialization
// As argument you can pass an object with:
// - collapsed: true -> shows the log collapsed
// - style -> the style applied to the action description
export const startLogging = ({ collapsed, style } = {}) => {
mobx.spy(event => {
@Harshit369
Harshit369 / pr.md
Created May 24, 2018 07:38 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@Harshit369
Harshit369 / README.md
Created March 20, 2018 10:24 — forked from roachhd/README.md
EMOJI cheatsheet ๐Ÿ˜›๐Ÿ˜ณ๐Ÿ˜—๐Ÿ˜“๐Ÿ™‰๐Ÿ˜ธ๐Ÿ™ˆ๐Ÿ™Š๐Ÿ˜ฝ๐Ÿ’€๐Ÿ’ข๐Ÿ’ฅโœจ๐Ÿ’๐Ÿ‘ซ๐Ÿ‘„๐Ÿ‘ƒ๐Ÿ‘€๐Ÿ‘›๐Ÿ‘›๐Ÿ—ผ๐Ÿ”ฎ๐Ÿ”ฎ๐ŸŽ„๐ŸŽ…๐Ÿ‘ป

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. โœˆ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: ๐Ÿ˜„

@Harshit369
Harshit369 / customEvents.js
Created February 25, 2018 09:33
Method to bind custom events to elements.
// first add appropriate event listener.
document.addEventListener('poke', function(e) {
console.log(e.detail);
})
// create a new custom event from CustomEvent cunstructor.
var pokeEvent = new CustomEvent('poke', {
detail: 'giggles'
});
@Harshit369
Harshit369 / requestQueue.service.js
Created November 29, 2017 21:49
Angular module/service for request queuing.
/**
* Reuest queue service
* USAGE:
* Normal: return api.get(uri, { params: args });
* With requestQueue: return requestsQueue.queueRequest(function () {
return api.get(uri, { params: args }); //this should return promise
});
*/
var module = ng.module('moduleName');
/**
@Harshit369
Harshit369 / destructuring.js
Created July 25, 2017 19:38 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@Harshit369
Harshit369 / post-receive
Created June 9, 2017 17:09 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then
@Harshit369
Harshit369 / object-watch.js
Created May 19, 2017 13:56 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/