Skip to content

Instantly share code, notes, and snippets.

View mribica's full-sized avatar

mmr mribica

  • Sarajevo, Bosnia and Herzegovina
View GitHub Profile
@mribica
mribica / create-react-app.markdown
Last active March 2, 2017 11:51
Create react app
brew update
brew install yarn

Add export PATH="$PATH:`yarn global bin`" to your profile

yarn start
    Starts the development server.
yarn run build
 Bundles the app into static files for production.
@mribica
mribica / heroku
Created October 13, 2016 11:16
Usefull heroku commands
# Restore heroku database backup
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump

Keybase proof

I hereby claim:

  • I am mribica on github.
  • I am mmr (https://keybase.io/mmr) on keybase.
  • I have a public key whose fingerprint is 91CC E70B 7C12 AB24 13CB E72C 9E94 AC8F B57F 36FA

To claim this, I am signing this object:

@mribica
mribica / breathe-sonic-pi.rb
Created January 6, 2016 12:17
The Prodigy - Breathe in SonicPi
use_bpm 130
base = 70
live_loop :theme do
use_synth :prophet
with_fx :distortion do
"2--2--5-2-5-4--2-4--1--1--".split("").each do |n|
sleep 0.5 and next if n == "-"
play base + n.to_i, amp: 1, cutoff: 90, sustain: 0.5
@mribica
mribica / intruder.rb
Last active January 19, 2018 10:07
intrusion detection
puts "Starting Intruder"
sleep 3
while true do
result = `ioreg -r -k AppleClamshellState -d 4 | grep AppleClamshellState | head -1`
lid_closed = result.split("=")[1].strip
puts "Closed #{lid_closed}"
if lid_closed == "No"
sleep 2
require 'viewpoint'
class EmailExchange
attr_accessor :folder_name
def initialize username, password, ews_endpoint, exchange_folder_name, proxy
if not (proxy.nil? or proxy.empty?)
Viewpoint::EWS::EWS.set_trust_ca './owasp_zap_root_ca.pem'
end
Viewpoint::EWS::EWS.endpoint = ews_endpoint
Viewpoint::EWS::EWS.set_auth username,password
@mribica
mribica / rbenv
Last active August 29, 2015 13:58
rbenv ruby with readline
$ brew update
$ brew install rbenv
$ brew install ruby-build
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ env CFLAGS='-g -O2' RUBY_CONFIGURE_OPTS="--with-readline-dir=/usr/include/readline" rbenv install 2.0.0-p451
$ rbenv global 2.0.0-p451
@mribica
mribica / fix-ruby-missing-psych.markdown
Created July 6, 2013 14:07
Fix "ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby."

Install libyaml

$ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
$ tar zxf yaml-0.1.4.tar.gz
$ cd yaml-0.1.4
$ ./configure
$ make
$ sudo make install
@mribica
mribica / minitest-setup
Last active December 18, 2015 20:38
minitest spec, guard, spring
group :development, :test do
gem 'minitest-focus'
gem 'guard-minitest'
gem 'factory-girl-rails'
gem 'database-cleaner'
end
gem 'spring'
$ guard init minitest
@mribica
mribica / default-response.rb
Created June 20, 2013 14:06
default response from routes file
namespace :api, :defaults => {:format => :json} do
namespace :v1 do
resources :people
end
end