Skip to content

Instantly share code, notes, and snippets.

View gauravmehla's full-sized avatar
🚀
to the sky and beyond

Gaurav Mehla gauravmehla

🚀
to the sky and beyond
View GitHub Profile
@NishiGaba
NishiGaba / media_controls.html
Last active April 27, 2020 12:07
Hide Audio and Video Download Controls
<body>
<audio controls>
<source src="your_mp3_file" type="audio/mpeg">
</audio>
<video width="100%" height="100%" controls>
<source src="your_video_url">
</video>
</body>
@nepsilon
nepsilon / how-to-use-mac-keychain-to-store-github-repos-credentials.md
Created July 18, 2017 06:50
How to use Mac KeyChain to store GitHub repos credentials? — First published in fullweb.io issue #108

How to use Mac KeyChain to store GitHub repos credentials?

You know the pain, you cloned a repo over HTTPS, and now Git asks you for your password each time you want to push or pull.

Chances are you already have the git credential-osxkeychain command installed. If not, just install Git with brew: brew install git.

Once installed, just tell Git to use the KeyChain to store your credentials:

git config --global credential.helper osxkeychain
@NishiGaba
NishiGaba / regex.js
Last active August 1, 2017 07:15
Regex for different combinations in Javascript
//Regex for only Alphanumeric Characters with Space Included
var regex = new RegExp("^[a-zA-Z ]+$");
//Verifying Contact Number
var contact = 1234567890;
var isnum = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/.test(contact);
//You can Refer this site for more Regex or You can Create your own Regex : http://regexr.com/
@NishiGaba
NishiGaba / upload_image.js
Last active August 1, 2017 07:14
Upload Image on Amazon S3
//Upload Image on Amazon S3 using Angular JS
$scope.loadImage = function() {
var input = document.getElementById('imgId');
var file = input.files[0];
//-------------- UPLOAD IMAGE ON AMAZON S3 -----------------//
$scope.creds = {
bucket: 'bucket',
access_key: '123XYZ',
@NishiGaba
NishiGaba / scrollbar.css
Created July 4, 2017 10:47
Hide Scrollbar
/*TO HIDE THE SCROLLBAR*/
::-webkit-scrollbar {
display: none !important;
}
@NishiGaba
NishiGaba / iterate-over-array.js
Last active November 29, 2023 10:27
8 Methods to Iterate through Array
//8 Methods to Iterate through Array
//forEach (Do Operation for Each Item in the Array)
[1,2,3].forEach(function(item,index) {
console.log('item:',item,'index:',index);
});
//map (Translate/Map all Elements in an Array to Another Set of Values.)
const oneArray = [1,2,3];
const doubledArray = oneArray.map(function(item) {
@NishiGaba
NishiGaba / markdown.md
Last active October 10, 2017 09:13
Mastering Markdown and Emoji Cheat Sheet
@willshiao
willshiao / aes.go
Last active January 19, 2024 16:18
AES 256-CFB in Node.js, Go, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
@rikyperdana
rikyperdana / android-sdk-linux-cli
Last active August 21, 2018 01:07 — forked from wenzhixin/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk lib32stdc++6 lib32z1
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
# install all sdk packages
cd android-sdk-linux/tools
./android update sdk --no-ui