This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"noImplicitAny": true, | |
"target": "ES5", | |
"module": "ES2015" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Credit: https://gist.github.com/SamanSh999/3ee8cad2859a900b7e36e1cff4204005 | |
# | |
# Instruction(macOS only): | |
# | |
# 1. Save this script to your home folder | |
# 2. Grant permission to script: chmod +x ~/bing-daily-wallpaper.sh | |
# 3. Install homebrew if you don't have it: https://brew.sh/ | |
# 4. Install jq: brew install jq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* JavaScript code to detect available availability of a | |
* particular font in a browser using JavaScript and CSS. | |
* | |
* Author : Lalit Patel | |
* Website: http://www.lalit.org/lab/javascript-css-font-detect/ | |
* License: Apache Software License 2.0 | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* Version: 0.15 (21 Sep 2009) | |
* Changed comparision font to default from sans-default-default, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// step 1, edit the code: | |
document.querySelector('.f8r-title').append('🎩'); | |
setInterval(() => { | |
const cards = document.querySelectorAll("MD-CARD-CONTENT"); | |
cards.forEach((card) => { | |
if (card.querySelector("img") === null && card.querySelector("a.say") === null) { | |
const sayTag = document.createElement("a"); | |
sayTag.className = "say"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require("request"); | |
const apiKey = "..."; | |
const youtubeUserName = "..."; | |
let videos = []; | |
let playlistId; | |
console.log("Getting videos..."); | |
// Get playlist ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regxURL = new RegExp(`(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])`, 'igm'); | |
const content = 'Hello www.google.com World http://yahoo.com'; | |
const urls = content.match(regxURL); // ["www.google.com", "http://yahoo.com"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setup msmtp for sending out email | |
# as an alternative to sendmail | |
# i prefer this because it is easier to install and configure than sendmail | |
# especially when using Gmail smtp servers | |
sudo -i | |
apt-get install msmtp | |
ln -s /usr/bin/msmtp /usr/sbin/sendmail | |
touch /var/log/msmtprc && chmod 666 /var/log/msmtprc | |
vim /etc/msmtprc | |
# config options: http://msmtp.sourceforge.net/doc/msmtp.html#A-user-configuration-file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// encrypt | |
function encrypt(string $data, string $key, string $method) { | |
$encrypted = openssl_encrypt($data, $method, $key, OPENSSL_RAW_DATA); | |
$encrypted = base64_encode($encrypted); | |
return $encrypted; | |
} | |
// decrypt | |
function decrypt(string $data, string $key, string $method) { | |
$data = base64_decode($data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Suspense, useState } from "react"; | |
import { unstable_createResource as createResource } from "react-cache"; | |
import { | |
Autocomplete as Combobox, | |
Input as ComboboxInput, | |
List as ComboboxList, | |
Option as ComboboxOption | |
} from "./Combobox"; | |
function App({ tabIndex, navigate }) { |
NewerOlder