Skip to content

Instantly share code, notes, and snippets.

View briankung's full-sized avatar

Brian Kung briankung

  • Chicago
View GitHub Profile
@briankung
briankung / docker-pry-rails.md
Last active January 2, 2025 05:19
Using pry-rails with Docker
@briankung
briankung / stealingDones.js
Last active October 24, 2016 19:19
stealing dones off of iDoneThis.com
copy( // copy() is a Chrome api call to copy to clipboard
$('.entry-body').map(
function(number, thing) {return thing.innerText}
).get().join("\n")
)
@briankung
briankung / emojiAutocomplete.user.js
Last active August 7, 2017 14:12
GitHub-like emoji autocomplete hacked together with emojilib and jquery-textcomplete
// ==UserScript==
// @name Emojis Everywhere
// @namespace https://github.com/briankung/
// @version 0.1
// @description GitHub-like emoji autocomplete hacked together with emojilib and jquery-textcomplete
// @author Brian Kung
// @match https://hangouts.google.com/
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery.textcomplete/1.7.3/jquery.textcomplete.min.js
// @grant GM_addStyle
@briankung
briankung / youtube2srt.rb
Last active June 7, 2018 22:31 — forked from lsloan/ Convert video subtitles from YouTube XML format to SubRip (.srt)
Convert XML Youtube subtitles to SubRip (srt) from YouTube ID or XML file
# Convert XML Youtube subtitles to SubRip (srt) format
# To download the subtitle in XML, put the code of the Youtube video
# at the end of the next url:
# http://video.google.com/timedtext?hl=en&lang=en&v=
# Usage:
#
# $ ruby youtube2srt.rb [input_filename] [output_filename]
#
# Where input_filename can be either the name of your xml file
@briankung
briankung / Signal 💔 ☠.md
Created September 19, 2017 01:37
Signal 💔 ☠

❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️

@briankung
briankung / oi.js
Created October 12, 2017 23:52
oi.js from PoC||GTFO
function millis() {
return Date.now();
}
function flip_coin() {
n = 0;
then = millis() + 1;
while (millis() <= then) {
n = !n;
@briankung
briankung / yoshida.rb
Last active November 19, 2017 04:13
Debugging the yoshida growth curve
YI = 1.6968467
B1 = -0.1915674
C = -1.8162469
def yoshida(i)
C + YI / (1 + B1 * (i ** (-C)))
end
(1..6).step(0.1).each do |i|
puts "#{i}:\t\t\t\t#{yoshida(i)}"
@briankung
briankung / parent.vue
Created December 22, 2017 18:02
This is not a good idea, but it's cool
<template>
<ToggleableFields :fields="toggleableFields" />
</template>
<script>
import ToggleableFields from 'checkout/address/toggleable_fields.vue'
export default {
@briankung
briankung / 00-toggle-click-rm.js
Last active January 22, 2018 17:35
Firefox bookmarklet for toggling element deletion on click - copy into Firefox bookmark to fuck shit up
javascript:void(
(
(document.fuckShitUp === undefined)
&&
(document.addEventListener('click', (e) => {
if (document.fuckShitUp) { e.preventDefault(), e.target.remove() }
}))
), (
document.fuckShitUp = !document.fuckShitUp
)