Skip to content

Instantly share code, notes, and snippets.

View wrick17's full-sized avatar
🎯
Focusing

Pratyush Poddar wrick17

🎯
Focusing
View GitHub Profile
@robbyrussell
robbyrussell / ohmyzsh-dropbox-sync.sh
Created February 8, 2012 15:20
Keep your @ohmyzsh ~/.zshrc in sync via dropbox
# Was asked how I keep my zshrc config sync'd between my computers with Dropbox
# Add a new directory in your Dropbox (or use an existing one)
mkdir -p ~/Dropbox/ohmyzsh
# move existing file to Dropbox
mv ~/.zshrc ~/Dropbox/ohmyzsh/zshrc
# symlink file back to your local directory
ln -s ~/Dropbox/ohmyzsh/zshrc ~/.zshrc
@kerimdzhanov
kerimdzhanov / random.js
Last active June 25, 2024 19:41
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@codematix
codematix / url-regex.md
Last active August 29, 2015 14:22
Regular Expressions to match URL components

Documentation

  1. Scheme - The scheme name consists of a sequence of characters beginning with a letter and followed by any combination of letters, digits, +, ., or -. Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. The scheme name is followed by a colon :.
  2. Host Name - Hostname labels may contain only the ASCII letters a through z (in a case-insensitive manner), the digits 0 through 9, and the -. While a hostname may not contain other characters, such as the underscore character _, other DNS names may contain the underscore.
  3. Port Number - A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.
  4. Path - If present, may optionally begin with a single forward slash /. It may not begin with two slash characters //. The path is a sequence of segments (conceptually similar to directories, though not necessarily representing them) separated by a forward s
@austinlyons
austinlyons / ReactApp.jsx
Created October 31, 2015 18:52
Simplified JSONLint clone in React w/ES6 & Flexbox
import React, { Component } from 'react';
export default class ReactApp extends Component {
constructor(props) {
super(props);
const placeholder = {
try: 'removing some whitespace',
or: 'add valid JSON',
then: ['then', 'click', 'format'],
@MaxySpark
MaxySpark / fmovies-9anime.user.js
Last active March 29, 2024 12:48
User Script to Get Direct Download Link of Movie Series and Anime from http://fmovies.to and http://9anime.to . First install "TAMPERMONKEY" OR "GREASEMONKEY" extention/plugin in your browser
// ==UserScript==
// @name Direct Download From fmovies
// @namespace http://maxyspark.com/
// @version 0.1
// @description Direct Download From fmovies
// @author MaxySpark
// @match http://fmovies.to/*
// @match https://fmovies.to/*
// @match http://9anime.to/*
// @grant none
@WebReflection
WebReflection / base64.js
Last active April 29, 2017 02:44
Quite possibly the smallest base 64 utility out there.
// base64.decode(base64.encode('💩'));
// Browsers
const base64 = {
encode: str => btoa(unescape(encodeURIComponent(str))),
decode: str => decodeURIComponent(escape(atob(str)))
};
/* ES3 compat version
var base64 = {