Skip to content

Instantly share code, notes, and snippets.

View probaldhar's full-sized avatar

Probal Chandra Dhar probaldhar

View GitHub Profile
# //"1234", 10
# //"1234", 37
# return true/false
def calculateSum(s, k):
# string to arr
# s = list(s)
return helper(s, k, len(s), 0)
@probaldhar
probaldhar / alexa-cheats.md
Created February 18, 2018 20:46 — forked from R3V1Z3/alexa-cheats.md
The ultimate cheatsheet for Amazon Alexa. See https://ugotsta.github.io/alexa-cheats/

Alexa Cheats

Commands, questions and easter eggs for Amazon Alexa enabled devices: https://ugotsta.github.io/alexa-cheats/

General

  • "Alexa, stop."
  • "Alexa, volume one/six/ten."
  • "Alexa, mute."
  • "Alexa, unmute."
  • "Alexa, repeat."
  • "Alexa, cancel."
@probaldhar
probaldhar / parser.c
Created September 7, 2017 15:18 — forked from mayoff/parser.c
recursive descent parser for a very simple tree grammar; see http://stackoverflow.com/questions/14085626
#include <stdio.h>
#include <stdlib.h>
typedef struct BinaryTree {
char info;
struct BinaryTree *left, *right, *father;
} BinaryTree;
typedef struct {
BinaryTree *node;
@probaldhar
probaldhar / Allow applications downloaded from anywhere in macOS Sierra
Last active February 19, 2017 21:14
Allow applications downloaded from anywhere in macOS Sierra
To run application that is downloaded from anywhere
In the terminal type this and hit enter,
sudo spctl --master-disable
After instaling do it
sudo spctl --master-enable
In terminal just hit this:
sudo -H pip install awscli --upgrade --ignore-installed six
@probaldhar
probaldhar / getting_id.php
Created November 6, 2015 07:48
Getting ID of page or post in wordpress
// Sometimes it's got really hard to get ID of a post or page in the starting of functions.php because then wp_query was not fired,
// so to getting any page ID or post ID in that situation you can use this code.
$url = explode('?', 'http://'.$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
$ID = url_to_postid($url[0]);
@probaldhar
probaldhar / substring.html
Last active August 29, 2015 14:25
CSS3 Attribute Selectors: Substring Matching
It's an attribute wildcard selector. In the sample you've given, it looks for any child element under .show-grid that has a class that CONTAINS span.
So would select the <strong> element in this example:
<div class="show-grid">
<strong class="span6">Blah blah</strong>
</div>
@probaldhar
probaldhar / gist:82eff5fdc7b6035a92e5
Created June 29, 2015 06:02
How to make bootable Mac OS X
Follow these steps that in the link
http://www.macworld.co.uk/how-to/mac/make-bootable-mac-os-x-1010-yosemite-install-drive-3575875/
@probaldhar
probaldhar / gist:1364b304dac3dc3d6af4
Last active August 29, 2015 14:21
Showing the file list which affect the last git commit
Go to the terminal and traverse to that directory and hit the command
git show --pretty="format:" --name-only
@probaldhar
probaldhar / gist:7ce8b7441d47fe315ddb
Created January 2, 2015 09:53
Run Multiple instance of VLC player in mac
Open the terminal and just hit the following command.
open -n /Applications/VLC.app
That's it, easy no?