Skip to content

Instantly share code, notes, and snippets.

@shime
shime / readme.md
Created Sep 30, 2014
run the minitest test suite without rake
View readme.md

To run bunch of Minitest tests in one go, without using Rake, use this command

$ ruby -e 'ARGV.each { |path| require "./#{path}" }' test/*.rb
@shime
shime / ngnix.conf
Created Oct 31, 2014
redirect non-www to www with or without ssl in ngnix
View ngnix.conf
# http://domain.com -> https://www.domain.com
# http://www.domain.com -> https://www.domain.com
server {
listen 80;
server_name domain.com www.domain.com;
return 301 https://www.domain.com$request_uri;
}
# https://domain.com -> https://www.domain.com
server {
@shime
shime / kata.md
Created Nov 19, 2014
text from kata at http://www.codewars.com/kata/a-chain-adding-function/. solution is in 3 lines of code.
View kata.md

We want to create a function that will add numbers together when called in succession.

add(1)(2) == 3 // true

We also want to be able to continue to add numbers to our chain.

add(1)(2)(3) == 6 // true
View keybase.md

Keybase proof

I hereby claim:

  • I am shime on github.
  • I am shime (https://keybase.io/shime) on keybase.
  • I have a public key whose fingerprint is 3032 0F07 65F2 3ABC 8BCB 3AF6 D409 B2B4 1F90 597C

To claim this, I am signing this object:

@shime
shime / Dockerfile
Last active Aug 29, 2015
confiig files
View Dockerfile
FROM base/archlinux:latest
# install dependencies
RUN pacman -Syu --noconfirm
RUN pacman --noconfirm -S base-devel yajl nodejs git openssh imagemagick python2
RUN ln -s /usr/bin/python2 /usr/bin/python
# install yaourt
WORKDIR /tmp/scratch
RUN curl https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz | tar zx
@shime
shime / readme.md
Last active Aug 29, 2015
debugging Ember components and views in the newer Ember versions
View readme.md
@shime
shime / gist:1077934
Created Jul 12, 2011
Initialize compass in new rails app
View gist:1077934
compass init rails . --using blueprint
View render_links.js.erb
@shime
shime / instance_eval explanation.rb
Created Jan 14, 2012
instance_eval explanation
View instance_eval explanation.rb
val = "pizdarija"
val.randomize
val.instance_eval do
def randomize
split(//).to_a.shuffle.join
end
View proba.c
#include <stdio.h>
int main(){
srand(time(NULL));
int i = 0;
int random;
for (i=0;i < 10;i++){
random = rand()%1000;
printf("%d\n",random);
}
return 0;
You can’t perform that action at this time.