Skip to content

Instantly share code, notes, and snippets.

@brianyang
brianyang / copy-transcript-clipboard.py
Last active April 2, 2024 22:08
chat with youtube video
import sys
from youtube_transcript_api import YouTubeTranscriptApi
def fetch_and_concat_transcript(video_id):
try:
# Fetching the transcript
transcript_list = YouTubeTranscriptApi.get_transcript(video_id)
# Concatenating text from the transcript
concatenated_text = " ".join(item['text'] for item in transcript_list)
print(concatenated_text)
@brianyang
brianyang / claim.sol
Created October 28, 2023 18:52
claim tokens
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "./interface/IDrop.sol";
import "../lib/MerkleProof.sol";
abstract contract Drop is IDrop {
/*///////////////////////////////////////////////////////////////
State variables
//////////////////////////////////////////////////////////////*/
@brianyang
brianyang / .bash_profile
Last active December 17, 2018 03:43
setup vim on windows 7
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# base-files version 4.2-3
# ~/.bash_profile: executed by bash(1) for login shells.
@brianyang
brianyang / keybindings.json
Created December 16, 2018 03:14
vscode keybindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+left",
"command": "workbench.action.focusPreviousGroup",
"when": "textInputFocus"
},
{
"key": "ctrl+right",
"command": "workbench.action.focusNextGroup",
@brianyang
brianyang / mail.sol
Created April 12, 2018 01:54
smart contract
pragma solidity ^0.4.8;
contract Charity {
address owner;
address boardMember1;
address boardMember2;
address recipient;
bool registeredYet;
mapping(address => bool) signatures;
### Keybase proof
I hereby claim:
* I am brianyang on github.
* I am brianyang (https://keybase.io/brianyang) on keybase.
* I have a public key ASAi-kJA1Z4j3AOP6wqALaMLdP7Dy9Gz4Xt6ykvES5NlGgo
To claim this, I am signing this object:
<!-- http://cwestblog.com/2017/12/11/responsive-youtube-embed/ -->
<iframe style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" src="https://www.youtube.com/embed/ZbZSe6N_BXs" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
@brianyang
brianyang / createPolyComponent.js
Created December 1, 2017 13:56 — forked from andrewimm/createPolyComponent.js
Google Poly API + React VR
import React from 'react';
import {Model} from 'react-vr';
function getFormat(formats, format) {
for (let i = 0; i < formats.length; i++) {
if (formats[i].formatType === format) {
return formats[i];
}
}
}
@brianyang
brianyang / easy-console.js
Created December 15, 2016 01:43 — forked from nuxodin/easy-console.js
Like to write to the console like this "console = xyz" instead of "console.log(xyz)" ?
!(function(){
var original = console;
Object.defineProperty(window, 'console', {
get:function(){
return original;
},
set:function(value){
original.log(value)
}
})
function d() {
if (j.length >= 1) {
var b = j.offset().top + j.height()
, c = g.scrollTop() + g.height()
, d = 100 - (b - c) / (b - g.height()) * 100;
a(".progress-bar").css("width", d + "%"),
d > 100 ? a(".progress-container").addClass("ready") : a(".progress-container").removeClass("ready")
}