Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'cinch'
bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.hackint.org"
c.channels = ["##hack-adm"]
c.nick = "beamerbot"
#c.plugins.plugins = [Tell]
end
@liliakai
liliakai / gist:9363bdf0f13c56f2dcb8bbe31e67f596
Created July 31, 2018 23:43
Crash running mocha tests in the main process on electron 1.8.x
```
Process: Electron [25377]
Path: /Users/USER/*/Electron.app/Contents/MacOS/Electron
Identifier: com.github.electron
Version: 1.8.7 (1.8.7)
Code Type: X86-64 (Native)
Parent Process: node [25376]
Responsible: iTerm2 [1252]
User ID: 501
------------------
console.log((function factorial(n){return ((n > 0) ? n * factorial(n-1) : n)})(10));
------------------
console.log(0.1 + 0.2)
------------------
#!/usr/bin/env ruby
require 'cinch'
RECENT_ENOUGH_MINS = 120
recent = Hash.new
class Song
@liliakai
liliakai / blinding.go
Last active August 29, 2015 13:57
My PLIBMTTBHGATY Project: RSA Blind Signatures in Go!
package blinding
import (
"bytes"
"crypto/rsa"
"math/big"
)
func Blind(data []byte, publicKey *rsa.PublicKey, r *big.Int) (blinded []byte) {
e := new(big.Int).SetInt64(int64(publicKey.E))
@liliakai
liliakai / keybase.md
Created March 6, 2014 22:53
keybase.md

Keybase proof

I hereby claim:

  • I am liliakai on github.
  • I am lk (https://keybase.io/lk) on keybase.
  • I have a public key whose fingerprint is 0931 BE86 1AF7 0454 E021 0E25 8CE1 97E4 769C 9B5F

To claim this, I am signing this object:

@liliakai
liliakai / SassMeister-output.css
Last active August 29, 2015 13:56
Generated by SassMeister.com.
/* how wide should the windows/screens be? */
.convo {
background-color: #eeeeee;
}
.bubble {
background-color: #fafafa;
color: #333333;
}
@liliakai
liliakai / gist:8015485
Last active December 31, 2015 16:39
Return a list of (blog post) node authors, as user objects sorted by last name.
function cmp_user_last_name($user1, $user2) {
return strcmp($user1->field_user_last_name, $user2->field_user_last_name);
}
function sorted_authors($nid) {
// get the author uids from the content node
$node = node_load($nid);
$authors = reset($node->field_authors);
global $user;
@liliakai
liliakai / gist:7983445
Last active December 31, 2015 11:59
Building Mutt with the sidebar patch.
# install dependencies if you want to use gpg, tls, or any other options
sudo apt-get install libgpgme11 libgpgme11-dev libgnutls-dev libsasl2-dev libgdbm-dev libncursesw5-dev
# grab the source. I use 1.5.21 because it is the latest compatible w/ sidebar
wget -q -O - ftp://ftp.mutt.org/mutt/devel/mutt-1.5.21.tar.gz | tar xvfz -
cd ./mutt-1.5.21
# apply sidebar patch to avoid endlessly switching views to check different
# folders. Use not-quite-the-latest version to avoid a bug where the first
# column of characters in the sidebar is nixed