Skip to content

Instantly share code, notes, and snippets.

View AnandChowdhary's full-sized avatar
🚀
Shipping

Anand Chowdhary AnandChowdhary

🚀
Shipping
View GitHub Profile
@AnandChowdhary
AnandChowdhary / A-Pen-by-Anand-Chowdhary.markdown
Last active February 11, 2021 02:47
iOS' slide to unlock feature made using HTML5 range
@AnandChowdhary
AnandChowdhary / hideEmail.php
Created November 15, 2017 14:07
PHP function to obfuscate email
<?php
function hideEmail($email) {
$email = explode("@", $email);
$name = $email[0];
if (strlen($name) > 3) {
$name = substr($name, 0, 2);
for ($i = 0; $i < strlen($email[0]) - 3; $i++) {
$name .= "*";
}
@AnandChowdhary
AnandChowdhary / capacitivesensor.ino
Last active September 11, 2018 09:33
Capacitive Sensor
#include <CapacitiveSensor.h>
CapacitiveSensor c = CapacitiveSensor(13, 12);
float observedRightValue = 1750.0;
float observedLeftValue= 5000.0;
void setup() {
Serial.begin(9600);
}
@AnandChowdhary
AnandChowdhary / tut4.ino
Created September 25, 2018 11:49
Tutorial 4
int potentiometerPin = A0;
int sensorPin1 = 3;
int sensorPin2 = 2;
long potentiometerValue = 0;
int sensor1Value = 0;
int sensor2Value = 0;
volatile long position;
void setup() {
// Set up internal pull up resistor for pin
#define analogInPin 0
const float Pi = 3.141592;
char sensorValue[480];
char outputValue[480];
int number,frameCurrent;
int pos0value, pos90value;
void setup() {
Serial.begin(38400);
for(int n=0;n<480;n++){
outputValue[n]=(char)127*sin((float)2*Pi*n/48)+127;
@AnandChowdhary
AnandChowdhary / conf.md
Created March 3, 2019 18:50
nginx creating a virtual host
cd /etc/nginx/sites-available/
sudo nano example.com

Config looks like this:

Keybase proof

I hereby claim:

  • I am anandchowdhary on github.
  • I am anandchowdhary (https://keybase.io/anandchowdhary) on keybase.
  • I have a public key ASBN1gN2uMEdRGO-rEzaXmjNcUlZPat4y7prKw1vtpun-Qo

To claim this, I am signing this object:

@AnandChowdhary
AnandChowdhary / Real-time life data
Last active December 9, 2019 20:09
Real-time data about my life in a pinned gist
TypeScript 15 hrs 35 mins █████████████▎░░░░░░░ 63.1%
JavaScript 3 hrs 44 mins ███▏░░░░░░░░░░░░░░░░░ 15.1%
Vue.js 1 hr 51 mins █▌░░░░░░░░░░░░░░░░░░░ 7.5%
JSON 52 mins ▋░░░░░░░░░░░░░░░░░░░░ 3.5%
CSS 43 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.9%
@AnandChowdhary
AnandChowdhary / README.md
Last active December 24, 2020 00:36
Convert a JSON key-value file URL to Netlify _redirects file

JSON KV to Netlify Redirects

Using npx with Node.js, you can run GitHub Gist scripts. This is a script to

Usage

For example, if you have a JSON file in a repo and its URL is https://raw.githubusercontent.com/TwenteMe/data/master/redirects.json, use:

npx https://gist.github.com/AnandChowdhary/bf1dce1400a6fc86afd1921085feff93 https://raw.githubusercontent.com/TwenteMe/data/master/redirects.json
@AnandChowdhary
AnandChowdhary / log-moment.js
Last active March 18, 2020 18:40
Just a console.log to test run-url
const moment = require("moment");
console.log("Date", moment());