Skip to content

Instantly share code, notes, and snippets.

View thecoducer's full-sized avatar
🐳
learning & unlearning

Mayukh Datta thecoducer

🐳
learning & unlearning
View GitHub Profile
@jaytaylor
jaytaylor / ._base64-url-shortener-poc.md
Last active December 16, 2022 10:39
URL shortener Base-62 encoder / decoder C++ Proof-of-Concept
@yangshun
yangshun / docusaurus-copy-button.md
Last active April 4, 2023 07:07
How to add the "Copy" button to code blocks in Docusaurus

Adding "Copy" (to Clipboard) Button

If you would like to add a button to your fenced code blocks so that users may copy the code, you can do so in Docusaurus. You will have to add some code to your Docusaurus project, as seen below.

Under static/js, create a file called code-block-buttons.js with the following:

// Turn off ESLint for this file because it's sent down to users as-is.
/* eslint-disable */
window.addEventListener('load', function() {
@woodRock
woodRock / daily-coding-problem-14.rb
Created August 28, 2018 12:18
The area of a circle is defined as πr^2. Estimate π to 3 decimal places using a Monte Carlo method. Hint: The basic equation of a circle is x2 + y2 = r2.
#!/usr/bin/env ruby
def pi_estimation(r=5)
inside =0.0
outside = 0.0
total = 0.0
rnd = Random.new
for i in 1 ... 10000
x = rnd.rand(-1*inside..inside)
@iamstoick
iamstoick / import.md
Created June 14, 2017 05:03
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

@aminou7
aminou7 / all in one seo pack for blogger 2017
Created April 25, 2017 13:13
all in one seo pack for blogger 2017
<!-- All In One SEO Pack 2017 v2.0 by langages-programmation.blogspot.com Start -->
<b:if cond='data:blog.pageType == "index"'>
<title><data:blog.pageTitle/></title>
<b:else/>
<title><data:blog.pageName/> - <data:blog.title/></title>
</b:if>
<b:if cond='data:blog.metaDescription != ""'>
<meta expr:content='data:blog.metaDescription' name='description'/>
</b:if>
<b:if cond='data:blog.pageType == "archive"'>
<!-- All In One SEO Pack for Blogspot By: http://besuccessblogger.com Starts Here -->
<b:if cond='data:blog.pageType == &quot;index&quot;'>
<title><data:blog.pageTitle/></title>
<b:else/>
<title><data:blog.pageName/> - <data:blog.title/></title>
</b:if>
<b:if cond='data:blog.metaDescription != &quot;&quot;'>
<meta expr:content='data:blog.metaDescription' name='description'/>
</b:if>
<b:if cond='data:blog.pageType == &quot;archive&quot;'>
@vitorfs
vitorfs / change_password.html
Created August 4, 2016 09:08
Django Change Password View
<form method="post">
{% csrf_token %}
{{ form }}
<button type="submit">Save changes</button>
</form>
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@gokulkrishh
gokulkrishh / media-query.css
Last active July 26, 2024 23:20
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@scottmagdalein
scottmagdalein / clickable-element.html
Last active March 15, 2023 18:01
Make the Mailchimp Subscriber popup appear on click
<!-- This is the HTML element that, when clicked, will cause the popup to appear. -->
<button id="open-popup">Subscribe to our mailing list</button>