Skip to content

Instantly share code, notes, and snippets.

# __ .__
# _______/ |_ ___.__.| | ____
# / ___/\ __< | || | _/ __ \
# \___ \ | | \___ || |_\ ___/
# /____ > |__| / ____||____/\___ >
# \/ \/ \/
autoload -U colors && colors
PS1="%{$fg[magenta]%}┌──%{$fg[red]%}%t - %n 💀 %d$reset_color"$'\n'"%{$fg[magenta]%}└─# %{$reset_color%}"
deb http://deb.debian.org/debian buster-backports main contrib non-free
@joubin
joubin / ffmpeg_nest.bash
Last active September 7, 2021 07:52
Download Nest Public Stream URLs for NAS/Local copy
ffmpeg -i "https://stream-us1-bravo.dropcam.com/nexus_aac/[CODE]" -f segment -segment_time 300 -strftime 1 %Y-%m-%d_%H-%M-%S-Garage.mp4
System.out.println(xstream.getClass().getPackage().getImplementationVersion());
XStream.setupDefaultSecurity(xstream);
xstream.allowTypes(new Class[]{Contact.class});
JWTVerifier verifier = new JWTVerifier(JWT_PASSWORD);
verifier.verify(accessToken);
<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE author [
<!ELEMENT author (#PCDATA)>
<!ELEMENT foo ANY >
<!ENTITY js "Testing 123">
<!ENTITY test "something">
]>
<foo>
<author>&test;</author>
<foo>&js;</foo>
PreparedStatement statement = connection.prepareStatement("SELECT * FROM user_data WHERE last_name = ?",
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
statement.setString(1, accountName);
Map<String, Object> commentMap = (new JacksonJsonParser()).parseMap(commentStr);
String textComment = String.valueOf(commentMap.get("text"));
String htmlEscapedTextComment = HtmlUtils.htmlEscape(textComment);
commentMap.put("text", htmlEscapedTextComment);
try {
commentStr = (new ObjectMapper()).writeValueAsString(commentMap);
} catch (JsonProcessingException ignored) {
}
@joubin
joubin / updateContacts.scpt
Last active July 15, 2017 03:31
If you are like me, you've carried over your contacts for many years. Sometimes from the years where you didn't have any contacts in different area codes. Over the years, I've updated the contacts without area codes manually. Recently, I left the country and ran into a problem calling US numbers with a European sim in my phone. The cooperate, no…
tell application "Contacts"
repeat with eachPerson in people
repeat with eachNumber in phones of eachPerson
set theNum to (get value of eachNumber)
if (theNum does not start with "+" and (theNum does not start with "1" and theNum does not start with "0")) then
set value of eachNumber to "+1" & theNum
else if (theNum starts with "1") then
set value of eachNumber to "+" & theNum
end if
end repeat
@joubin
joubin / report.xml
Created February 8, 2017 06:12
lottie report from VisualCodeGrepper
<?xml version="1.0" encoding="utf-8"?>
<!--XML Export of VCG Results for directory: . Scanned for Java security issues.-->
<CodeIssueCollection>
<CodeIssue>
<Priority>5</Priority>
<Severity>Low</Severity>
<Title>Operation on Primitive Data Type</Title>
<Description>The code appears to be carrying out a mathematical operation on a primitive data type. In some circumstances this can result in an overflow and unexpected behaviour. Check the code manually to determine the risk.</Description>
<FileName>Z:\Users\joubin\Downloads\scanthis\lottie\src\main\java\com\airbnb\lottie\AnimatableColorValue.java</FileName>
<Line>18</Line>