Skip to content

Instantly share code, notes, and snippets.

Avatar

Lilia liliakai

  • Open WhisperSystems
View GitHub Profile
View index.rb
#!/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 Jul 31, 2018
Crash running mocha tests in the main process on electron 1.8.x
View gist:9363bdf0f13c56f2dcb8bbe31e67f596
```
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
View qi.js
------------------
console.log((function factorial(n){return ((n > 0) ? n * factorial(n-1) : n)})(10));
------------------
console.log(0.1 + 0.2)
------------------
View gist:10443308
#!/usr/bin/env ruby
require 'cinch'
RECENT_ENOUGH_MINS = 120
recent = Hash.new
class Song
@liliakai
liliakai / blinding.go
Last active Aug 29, 2015
My PLIBMTTBHGATY Project: RSA Blind Signatures in Go!
View blinding.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))
View 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 Aug 29, 2015
Generated by SassMeister.com.
View SassMeister-output.css
/* how wide should the windows/screens be? */
.convo {
background-color: #eeeeee;
}
.bubble {
background-color: #fafafa;
color: #333333;
}
@liliakai
liliakai / gist:8015485
Last active Dec 31, 2015
Return a list of (blog post) node authors, as user objects sorted by last name.
View gist:8015485
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 Dec 31, 2015
Building Mutt with the sidebar patch.
View gist:7983445
# 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