This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libqt4-dev xvfb | |
sudo gem install capybara-webkit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git alias | |
git config alias.st status | |
# tool I need | |
apt-get install gitg | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.vagrantbox.es/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Bar | |
extend ActiveSupport::Concern | |
include Foo | |
included do | |
self.method_injected_by_foo | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division # allows floating point division from integers | |
import FreeCAD, Part, math | |
from FreeCAD import Base | |
class ProfileShape: | |
def __init__(self, obj): | |
''' Add the properties: Radius, Eccentricity, Height, Segments (see Property View) ''' | |
obj.addProperty("App::PropertyLength","Length","Airfoil","Forward pos").Length=100.0 | |
obj.addProperty("App::PropertyFloat","XPos","Airfoil","Sideways pos").XPos=0.0 | |
obj.addProperty("App::PropertyFloat","YPos","Airfoil","Forward pos").YPos=0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# script is searching for all the url and path helpers that does not exist | |
# | |
search_result = `egrep -o -r "([a-z][a-z]+_){2,10}(path|url)" app` | |
routes = `rake routes` | |
def without_path(name) | |
name.split('_')[0..-2].join('_') | |
end | |
helpers = search_result.split("\n").map { |l| l.split(':').last}.compact.uniq | |
valid_names = routes.split("\n").map { |l| (l =~ /^\s*([a-z_]+)\s*[A-Z\|]+/) ? $1 : nil }.compact |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
def split(array) | |
middle = array.length / 2 | |
[array[0..(middle-1)], array[middle..-1]] | |
end | |
def merge(a, b) | |
i = j = 0 | |
result = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'matrix' | |
require 'byebug' | |
require 'rspec' | |
include Math | |
def sqr(x) | |
x * x | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install arduino ide | |
sudo apt-get update && sudo apt-get install arduino arduino-core | |
# necessary to get into dialup group (at least for me), maybe reboot afterwards | |
sudo apt-get remove modemmanager | |
# add user to the dialout group | |
sudo usermod -a -G dialout <my-username> | |
# arduino should work now without beeing root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prims = Stream.unfold({2, []}, fn {next, list} -> if(Enum.any?(list, &(rem(next, &1) == 0)), do: {nil, {next+1, list}}, else: {next, {next+1, [next|list]}}) end) |
OlderNewer