Skip to content

Instantly share code, notes, and snippets.

import random
titles = ['In Sit Est', 'Interdum Posuere Adipiscing', 'Venenatis Lacus A Aliquet', 'Nulla Amet Eget Ac Fermentum', 'Nec Vivamus Tortor', 'Primis Fringilla Commodo', 'Aenean Sit Eget', 'Amet Eget Sapien', 'Porttitor Vitae Neque Aliquam', 'In Adipiscing Ut Interdum Justo', 'Non Nec A Nunc', 'Et Sed Lacus', 'At Sollicitudin Dolor', 'Ligula Bibendum Sagittis Tincidunt In', 'Et At Commodo Nibh Etiam', 'Sem Est Sapien', 'Venenatis Ante Dolor Quam Id', 'Risus Placerat Interdum Malesuada Non', 'Habitasse Nunc Justo Eget', 'Donec Sed Vulputate', 'Feugiat Consectetur Enim', 'Vestibulum Donec Ac Sed Ante', 'Habitasse Sit Tortor', 'Et Nec Amet']
bodies = ['Vestibulum consequat orci nec quam aliquam, eu imperdiet diam sagittis. Nam pharetra scelerisque libero a sollicitudin. Curabitur eget mattis arcu. Morbi pellentesque tempus metus, id tempor justo varius in. Morbi congue, dolor ac viverra auctor, lectus nisi tincidunt quam, ac dignissim justo est et orci. Etiam placerat massa eros, in placerat mauris v
@krmbzds
krmbzds / dogeminer_se.iim
Created May 1, 2014 20:14
Silly iMacros script plays www.dogeminer.se
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
EVENT TYPE=CLICK SELECTOR="#ui-id-1" BUTTON=0
WAIT SECONDS=0.1
EVENT TYPE=CLICK SELECTOR="#buyrig" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#buybase" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#buyrocket" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#buykitten" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#buykennel" BUTTON=0
@krmbzds
krmbzds / jumpstart_R.sh
Last active August 29, 2015 14:01
Jumpstart R Programming on Ubuntu 14.04
#!/bin/bash
sudo apt-get install r-base r-base-dev r-cran-testthat
wget -c `wget -qO- http://www.rstudio.com/ide/download/desktop | grep "Ubuntu" | grep "amd64\.deb" | sed -n "/href/ s/.*href=['\"]\([^'\"]*\)['\"].*/\1/gp" | head -1` && \
sudo apt-get -f install && \
sudo apt-get -y install libjpeg62 && \
sudo apt-get -y install libcurl4-openssl-dev && \
sudo dpkg -i rstudio-*-amd64.deb && \
sudo rm -f rstudio-*-amd64.deb && \
echo 'install.packages("swirl", repos="http://cran.r-project.org" )' | sudo R --no-save && \
sudo rm -f jumpstart_R.sh
@krmbzds
krmbzds / rmd2pdf.sh
Created May 27, 2014 12:10
R Markdown to PDF (Using pandoc and a LaTeX engine)
#!/bin/bash
RMDFILE=$1 # The filename without .md extention
Rscript -e "require(knitr); require(markdown); knit('$RMDFILE.Rmd', '$RMDFILE.md'); markdownToHTML('$RMDFILE.md', '$RMDFILE.html', options=c('use_xhml'))"
pandoc -s $RMDFILE.md -o $RMDFILE.pdf
from SimpleCV import Image
import pytesseract
img = Image("http://i.imgur.com/LU4q5IK.jpg")
img = img.invert().binarize().scale(5)
pytesseract.image_to_string(img)
# Out[5]: '58 +69'
@krmbzds
krmbzds / rescuetime_export.py
Last active May 28, 2016 22:40 — forked from b-luu/RTExport
RescueTime Data Export
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# RescueTime Data Exporter
# Dan Nixon 18/09/2011
# Chris Burgess 03/08/2015
# Brice Luu 20/05/2016
# Kerem Bozdas 29/05/2016
import urllib
@krmbzds
krmbzds / yardoc_cheatsheet.md
Created August 19, 2016 12:53 — forked from chetan/yardoc_cheatsheet.md
YARD cheatsheet

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

Types

A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

@krmbzds
krmbzds / life-percentage.12h.rb
Created August 25, 2016 06:30
Life Percentage plugin for BitBar
#!/usr/bin/env ruby
# <bitbar.title>Life Percentage</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Kerem Bozdaş</bitbar.author>
# <bitbar.author.github>krmbzds</bitbar.author.github>
# <bitbar.desc>Shows what percentage of life you have lived.</bitbar.desc>
# <bitbar.image>http://i.imgur.com/DbXIhiS.png</bitbar.image>
# <bitbar.dependencies>ruby</bitbar.dependencies>
@krmbzds
krmbzds / sidekiq_worker.sublime-snippet
Last active November 24, 2016 14:14
Sidekiq Worker Snippet
<snippet>
<content><![CDATA[
class $1Worker
include Sidekiq::Worker
sidekiq_options :queue => :${2:default}, :retry => ${3:1}, :backtrace => ${4:false}
def perform($5)
$6
end