Skip to content

Instantly share code, notes, and snippets.

View millisami's full-sized avatar
🎯
Focusing on landing a Web3 Job

Sachin Sagar Rai millisami

🎯
Focusing on landing a Web3 Job
View GitHub Profile
@millisami
millisami / Vagrantfile
Last active December 22, 2015 13:59
Vagrantfile server
sudo apt-get update
sudo apt-get -y install curl
curl -L get.rvm.io | bash -s stable --auto
source ~/.bash_profile
rvm requirements
sudo apt-get install -y build-essential openssl libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libxml2-dev libxslt-dev python-software-properties
rvm install ruby
@millisami
millisami / layout_helper.rb
Created September 2, 2013 13:22
layout helpers
# These helper methods can be called in your template to set variables to be used in the layout
# This module should be included in all views globally,
# to do so you may need to add this line to your ApplicationController
# helper :layout
module LayoutHelper
def title(page_title, show_title = true)
content_for(:title) { h(page_title.to_s) }
@show_title = show_title
end
@millisami
millisami / test stdout
Last active December 20, 2015 09:49
test.rb
zeus test spec/acceptance/learning_areas_spec.rb:22
No DRb server is running. Running in local process instead ...
Run options: include {:locations=>{"./spec/acceptance/learning_areas_spec.rb"=>[22]}}
Learning area pages
Slow factory: "child" using strategy "create"
Slow factory: "child" using strategy "create"
cache: [GET /videos/1] miss
cache: [GET /assets/head.js] miss, store
cache: [GET /assets/application.css] miss, store
@millisami
millisami / gist:6061824
Created July 23, 2013 11:58
cache logger ugly
#FILE: config/environments/test.rb
class DisableAssetsLogger
def initialize(app)
@app = app
Rails.application.assets.logger = Logger.new('/dev/null')
end
def call(env)
previous_level = Rails.logger.level
@millisami
millisami / octopress bug
Created July 7, 2013 13:21
octopress does not start the server
$ git clone git://github.com/imathis/octopress.git octopress-new
$ cd octopress-new
$ bundle
$ bundle exec rake watch
Starting to watch source with Jekyll and Compass.
directory source/stylesheets/
create source/stylesheets/screen.css
Configuration from /Users/millisami/Code/octopress-new/_config.yml
>>> Change detected at 18:47:05 to: screen.scss
Auto-regenerating enabled: source -> public
## Listener verbose log
ubuntu@ip-10-86-229-133:~$ sudo ./gor-linux-amd64 listen -p=80 -r="localhost:28020" -verbose=true
Version: 0.3
Listening for HTTP traffic on 80 port
Forwarding requests to replay server: localhost:28020
2013/06/25 12:28:47 Error while parsing request: b32a7da; __utmb=109050450.2.10.1372162652; __utmc=109050450; kvcd=1372163182598; km_vs=1; mp_03d1c47374408c67e078699b1ffbdf75_mixpanel=%7B%22distinct_id%22%3A%20%2213d8748965e2b-0cd07e5db6d96d-436e2b42-13c680-13d874896604b5%22%2C%22%24initial_referrer%22%3A%20%22%24direct%22%2C%22%24initial_referring_domain%22%3A%20%22%24direct%22%7D
Connection: keep-alive
@millisami
millisami / gist:5657872
Created May 27, 2013 16:16
php_pear.log
* php_pear[mail] action install[2013-05-27T15:50:45+00:00] INFO: Processing php_pear[mail] action install (mediawiki::setup line 22)
Retrieving data...0%
....50%...MATCHED PACKAGES, CHANNEL PEAR.PHP.NET:
=======================================
PACKAGE STABLE/(LATEST) LOCAL
Mail 1.2.0 (stable) Class that provides multiple interfaces for sending emails
Mail_IMAP 1.1.0RC2 (beta) Provides a c-client backend for webmail.
Mail_IMAPv2 0.2.1 (beta) Provides a c-client backend for webmail.
Mail_Mbox 0.6.3 (beta) Read and modify Unix MBOXes
Mail_Mime 1.8.7 (stable) Mail_Mime provides classes to create MIME messages.
○ VAGRANT_LOG=debug vagrant up --provider=aws 1.9.3-p194@global
INFO global: Vagrant version: 1.2.2
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/init/plugin.rb
INFO manager: Registered plugin: init command
#!/bin/sh
# ====================================================================
# This is the tmux configuration I use for setting up my Ruby on Rails
# Tutorial session
#
BASE="$HOME/sites/sample_app"
cd $BASE
tmux start-server
if Rails.env.development?
module Dragonfly
module DataStorage
class FileDataStore
def retrieve(relative_path)
validate_uid!(relative_path)
path = absolute(relative_path)
pathname = Pathname.new(path)
if !pathname.exist?