This file contains hidden or 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
# http://stackoverflow.com/questions/8488758 | |
function matlab_figure_without_focus(h) | |
set(0, 'CurrentFigure', h); |
This file contains hidden or 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
var LABEL = '<your GMail label name storing Google Scholar Alert>' | |
var RECEIVER = '<your Blogger e-mail address>' | |
function get_quota() { | |
var quota = MailApp.getRemainingDailyQuota() | |
Logger.log(quota) | |
return quota | |
} | |
function myFunction() { |
This file contains hidden or 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
var idLogoContainer = document.getElementById('logo-container') | |
var classLogoRed = idLogoContainer.getElementsByClassName('logo-red') | |
console.log(classLogoRed) | |
if (classLogoRed.length) { | |
var tag = classLogoRed[0] | |
console.log(tag) | |
tag.style.backgroundImage = 'none' | |
console.log(tag.style.background) | |
} |
This file contains hidden or 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 [header, payload, signature] = jwt.split('.'); | |
const buffer = Buffer.from(payload, 'base64'); | |
const decoded = JSON.parse(buffer); |
This file contains hidden or 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
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files | |
- name: Check if there is any change | |
id: get_changes | |
# deprecated. see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ | |
#run: echo "::set-output name=changed::$(git status --porcelain | wc -l)" | |
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT | |
- name: Do something if there is any change | |
if: steps.get_changes.outputs.changed != 0 | |
run: do something |
This file contains hidden or 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 { readFileSync, writeFileSync } = require("fs"); | |
function indexOfUnicode(s, u) { | |
let i = -1; | |
for (i = 0; i < s.length; i++) { | |
if (s.charCodeAt(i) === u) { | |
break; | |
} | |
} | |
return i; |
This file contains hidden or 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
name: Publish | |
on: | |
#push: | |
#branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
This file contains hidden or 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
function Component() { | |
const onChange = (e) => { | |
const file = e.target.files?.[0]; | |
if (!file) { | |
return; | |
} | |
const reader = new FileReader(); | |
reader.addEventListener('load', () => { | |
console.log(reader.result); | |
}); |
This file contains hidden or 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
/* Yello hyperlink on green background */ | |
.page-ref { | |
color: #E0D772; | |
} | |
/* Yellow underline on green background */ | |
.block-ref { | |
border-bottom-color: #E0D772; | |
} |