Skip to content

Instantly share code, notes, and snippets.

@asimihsan
asimihsan / enwiki-20191202-top-10k.txt
Last active Jan 26, 2020
Top 10k words based on 20200113 Wikipedia dump - English
View enwiki-20191202-top-10k.txt
# See: https://github.com/asimihsan/word-frequencies
# Raw frequencex.txt.gz file: https://www.dropbox.com/s/ectbjiupvesxruc/enwiki-20191202-frequencies.txt.gz?dl=0
# Uses Debian wamerican + wbritish + wcanadian as a dictionary. You get much better results if you use 3of6game as
# a dictionary.
the
and
was
for
with
from
@asimihsan
asimihsan / plwiki-20200113-top-10k.txt
Last active Jan 26, 2020
Top 10k words based on 20200113 Wikipedia dump - Polish
View plwiki-20200113-top-10k.txt
# See: https://github.com/asimihsan/word-frequencies
# Raw frequencies.txt.gz file: https://www.dropbox.com/sh/yy9dnue1kvf0kuw/AAC1ZpoEnH_dn4FLLN1RHf2Pa?dl=0
się
dostęp
ang
jest
przez
oraz
jako
nie
@asimihsan
asimihsan / setup.md
Created Mar 13, 2017
Installing Deep Learning tools on an AWS P2 instance from scratch
View setup.md
View AcademicPerformanceEnhancement.gnaural
<?xml version="1.0"?>
<!-- See http://gnaural.sourceforge.net -->
<schedule>
<gnauralfile_version>1.20101006</gnauralfile_version>
<gnaural_version>1.0.20110215</gnaural_version>
<date>20160206 14:09:00</date>
<title>AcademicPerformanceEnhancement</title>
<schedule_description>Alternate between 14 Hz and 22 Hz (http://preview.tinyurl.com/zt4wm2a)</schedule_description>
<author>asymptote</author>
<totaltime>20.0</totaltime>
@asimihsan
asimihsan / hook.rb
Created Feb 1, 2016
Hook for letsencrypt.sh to do DNS challenges
View hook.rb
#!/usr/bin/env ruby
require 'aws-sdk'
require 'pry'
require 'awesome_print'
# ------------------------------------------------------------------------------
# Credentials
# ------------------------------------------------------------------------------
# pick up AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY by default from
View mean_stddev.py
import math
students = sc.parallelize([
[100, "Alice", 8.5, "Computer Science"],
[101, "Bob", 7.1, "Engineering"],
[102, "Carl", 6.2, "Engineering"],
])
def extract_degree_grade_count(row):
return (row[3], (row[2], row[2] ** 2, 1))
@asimihsan
asimihsan / Foo.java
Last active Aug 29, 2015
Running Python interactively on Mac and Linux. Trick is to attach a PTY to it using unbuffer or script.
View Foo.java
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
class Foo {
public static void main(String[] args) throws IOException, InterruptedException {
@asimihsan
asimihsan / memory-usage.jira
Created Jul 24, 2014
Memory usage on Linux systems
View memory-usage.jira
Memory usage on Linux systems
(TODO I'm going to edit and refactor this article a bit)
h2. tl;dr
* The Proportional Set Size (PSS) of a process is the count of pages it
has in memory, where each page is divided by the number of processes
sharing it.
* The Unique Set Size (USS) of a process is the count of unshared pages.
View .tmux.conf
# status bar
set-option -g status-utf8 on
set-option -g default-shell /bin/zsh
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
@asimihsan
asimihsan / tornadolog.py
Last active Oct 28, 2019
Tail a file over HTTP WebSockets with a Tornado server.
View tornadolog.py
#!/usr/bin/env python
import logging
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.websocket
from tornado.options import define, options
from tornado.process import Subprocess
You can’t perform that action at this time.