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
// For https://us.etrade.com/etx/sp/stockplan/#/myAccount/stockPlanConfirmations | |
// NOTE! The ETrade website has been updated, this script no longer works, as of Feb 6, 2025. | |
0&&(async()=>{let $=new TextEncoder,e=$$("td[data-content=Confirmation] > a").map(($,e)=>({url:$.href,name:`file_${e+1}.pdf`})),f=async({url:$,name:e})=>{let f=await fetch($);if(!f.ok)throw Error(`Failed to fetch: ${$}`);let x=new Uint8Array(await f.arrayBuffer());return{name:e,fileData:x}},x=async e=>{let x=[],l=0,t=[],n=await Promise.all(e.map(f));for(let{name:h,fileData:a}of n){let i=$.encode(h),g=[80,75,3,4,20,0,0,0,0,0,0,0,0,0,...[,,,,].fill(0),255&a.length,a.length>>8&255,a.length>>16&255,a.length>>24&255,255&a.length,a.length>>8&255,a.length>>16&255,a.length>>24&255,255&i.length,i.length>>8&255,0,0];x.push(new Uint8Array(g)),x.push(i),x.push(a),t.push({offset:l,fileNameBytes:i,fileHeader:g,fileSize:a.length}),l+=g.length+i.length+a.length}let o=[],r=0;for(let{offset:p,fileNameBytes:c,fileHeader:s,fileSize:d}of t){let u=[80,75,1, |
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
import json | |
import os | |
import xml.etree.ElementTree as ET | |
import requests | |
from langchain.agents import AgentExecutor, create_openai_tools_agent | |
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder | |
from langchain_core.tools import tool | |
from langchain_openai import ChatOpenAI |
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
# Enterprise version of is_even. | |
# (Don't use this in a startup.) | |
# | |
# python is_even.py 1 | |
# False | |
# python is_even.py 2 | |
# True | |
# python is_even.py 101 | |
# False | |
# python is_even.py 1 |
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
HAI 1.3 | |
BTW THIS IS LOLCODE | |
BTW IT IS GOOD TO SUMMARIZE NUMBERS | |
HOW IZ I SUMMARIZE YR NUMBER | |
I HAS A SOLUSHUN ITZ 0 | |
I HAS A VAR ITZ A NUMBR | |
I HAS A SECRET ITZ A NUMBR |
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
# See http://jsfiddle.net/isak_b/hp6fj/ for live demo. | |
asUtf16 = (str) -> | |
buffer = new ArrayBuffer(str.length * 2) | |
bufferView = new Uint16Array(buffer) | |
bufferView[0] = 0xfeff | |
for i in [0..str.length] | |
val = str.charCodeAt(i) | |
bufferView[i + 1] = val | |
bufferView |
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
1. Open http://translate.google.com/#ja/en/gh%20bchtk%20pv%20zk%20pv%20pv%20zk%20pv%20zk%20kz%20kh%20pv%20zk%20pv%20zk%20bchkt%20zk%20pzk%20pzk%20kkkkkk%20bsch%0Abchtk%20zk%20kppp%20bsch%20sss%20gh. | |
2. Press the left speaker button to listen. | |
3. Record output with: | |
parec --format=s16le --device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | oggenc --raw --quiet -o dump.ogg - |
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
#!/bin/bash | |
# Install "ni" prefix for executing scripts without allowing internet access. | |
# Tested on Ubuntu 13.04. | |
# Example: | |
# $ ni ping google.com | |
# ping: unknown host google.com | |
# | |
# $ ping google.com | |
# PING google.com (173.194.40.229) 56(84) bytes of data. | |
# 64 bytes from arn02s06-in-f5.1e100.net (173.194.40.229): icmp_req=1 ttl=59 time=1.41 ms |
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
<script> | |
(function(){ | |
console.log('%c very console', | |
'color: blue; font-size: 24px; font-family: "Comic Sans MS"'); | |
console.log('%c such script', | |
'color: green; font-size: 18px; font-family: "Comic Sans MS"'); | |
Object.defineProperty(console, '_commandLineAPI', { |
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
for f in `find . -name '*.js'`; do js2coffee $f > ${f%%js}coffee && rm $f; done |
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
#!/bin/bash | |
# A variant of watch, with smarter color support etc. | |
[[ $SLEEP ]] || SLEEP=2 | |
cmd=$* | |
prev_output="" | |
while true ; do | |
output="$( $cmd 3>&1 2>&3 )" |
NewerOlder