This file contains 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
# search all Sketchup::ComponentInstance included partial_name and apply a material | |
def apply_material_on_all_instance material_name, partial_name | |
material = Sketchup.active_model.materials[material_name] | |
Sketchup.active_model.definitions.each{|d| | |
if d.name.include? partial_name | |
puts d.name | |
d.instances.each{ |inst| | |
inst.material = material | |
puts "\tinstance colored" | |
} |
This file contains 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
if File.extname(file) == '.skp' | |
file_src = File.join $remote_path, file | |
file_dest = File.join $model_path, file | |
# if file already exists but a newer version exists on remote, we add it | |
if File.exists?(file_dest) and ( File.mtime(file_src).to_i > File.mtime(file_dest).to_i ) | |
FileUtils.cp(file_src, file_dest) | |
puts "[*] #{file} %s" % $lHandler['updated'] | |
yield "#{file} %s" % $lHandler['updated'] | |
# if file not exists we add it to the local library |
This file contains 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
# convert all files from the given directory into the given format | |
# | |
# @note For SketchUp Pro 7.1+, valid extensions include dae, kmz, 3ds, dwg, dxf, fbx, obj, wrl, and xsi. SketchUp Free only supports dae and kmz. (see http://www.sketchup.com/intl/en/developer/docs/ourdoc/model#export) | |
# | |
# @param src_path [String] as path were sketchup files are stored | |
# @param dest_path [String] as output path after convertion | |
# @param export_format [String] as output format | |
def convert_sketchup_files src_path, dest_path, export_format | |
format_available = %w(dae kmz 3ds dwg dxf fbx obj wrl xsi pdf) |
This file contains 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 software-properties-common | |
sudo add-apt-repository ppa:ondrej/php5-5.6 | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install php5 |
This file contains 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 update && sudo apt-get upgrade | |
echo "deb http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free" >> /etc/apt/sources.list | |
echo "#deb-src http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free" >> /etc/apt/sources.list | |
sudo gpg --keyserver pgpkeys.mit.edu --recv-key CCD91D6111A06851 | |
sudo su | |
gpg --armor --export CCD91D6111A06851 | apt-key add - | |
exit |
This file contains 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
<?php | |
/** | |
* Represent a custom Directory class more easy to use for my need | |
*/ | |
class DirectoryLister implements JsonSerializable{ | |
private $path; | |
/** |
This file contains 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
function defer(method) { | |
if (window.jQuery) | |
method(); | |
else | |
setTimeout(function() { defer(method) }, 50); | |
} |
This file contains 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
# Edit materials | |
Sketchup.active_model.materials.to_a.each do |mat| | |
case mat.name | |
when / Ext/ | |
Sketchup.active_model.materials.remove(mat) unless mat.deleted? | |
when / Int/ |
This file contains 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
#!/bin/bash | |
green='\e[0;32m' | |
darkred='\e[1;31m' | |
lightblue='\e[1;34m' | |
default='\033[0m' | |
echo -e "${darkred}***Bootstrap Linux Mint setup***${default}" | |
This file contains 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 'git' | |
require 'fileutils' | |
require 'date' | |
require 'pathname' | |
desc "Print directory-tree" | |
task :tree, [:folder, :folder_only] do |t, args| | |
args.with_defaults(:folder_only => false) | |
$folder_only = args.folder_only == "true" |
OlderNewer