Skip to content

Instantly share code, notes, and snippets.

View renews's full-sized avatar
😀

Renê Schneider renews

😀
View GitHub Profile
@renews
renews / time_elapsed.rb
Last active August 17, 2017 19:28
Show the elapsed time formated as HH:MM:SS in ruby.
start_time = Time.now
Time.at((start_time - Time.now).to_i.abs).utc.strftime '%H:%M:%S'
Sub Test()
Dim wb As Workbook
Dim ThisSheet As Worksheet
Dim NumOfColumns As Integer
Dim RangeToCopy As Range
Dim RangeOfHeader As Range 'data (range) of header row
Dim WorkbookCounter As Integer
Dim RowsInFile 'how many rows (incl. header) in new files?
@renews
renews / list_memcache_keys.rb
Last active September 28, 2016 19:54 — forked from bkimble/gist:1365005
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
@renews
renews / gist:f1707b8d1882819ce962
Created March 21, 2015 15:31
Babun Inside ConEmu
Create a new task
Task parameters /icon "%userprofile%\.babun\cygwin\bin\mintty.exe" /dir "%userprofile%"
Commands %userprofile%\.babun\cygwin\bin\mintty.exe -
@renews
renews / CameraZoom
Created March 12, 2015 21:53
Unity - Camera Zoom With mouse
var ZoomAmount : float = 0; //With Positive and negative values
var MaxToClamp : float = 10;
var ROTSpeed : float = 10;
function Update() {
ZoomAmount += Input.GetAxis("Mouse ScrollWheel");
ZoomAmount = Mathf.Clamp(ZoomAmount, -MaxToClamp, MaxToClamp);
var translate = Mathf.Min(Mathf.Abs(Input.GetAxis("Mouse ScrollWheel")), MaxToClamp - Mathf.Abs(ZoomAmount));
gameObject.transform.Translate(0,0,translate * ROTSpeed * Mathf.Sign(Input.GetAxis("Mouse ScrollWheel")));
}
@renews
renews / cameraFOV
Created March 12, 2015 21:52
Camera FOV Unity - Control by Mouse
var minFov: float = 15f;
var maxFov: float = 90f;
var sensitivity: float = 10f;
function Update () {
var fov: float = Camera.main.fieldOfView;
fov += Input.GetAxis("Mouse ScrollWheel") * sensitivity;
fov = Mathf.Clamp(fov, minFov, maxFov);
Camera.main.fieldOfView = fov;
}
@renews
renews / Console.cs
Last active August 29, 2015 14:16 — forked from mminer/Console.cs
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// A console to display Unity's debug logs in-game.
/// </summary>
public class Console : MonoBehaviour
{
struct Log
{
// Smooth Follow from Standard Assets
// Converted to C# because I fucking hate UnityScript and it's inexistant C# interoperability
// If you have C# code and you want to edit SmoothFollow's vars ingame, use this instead.
using UnityEngine;
using System.Collections;
public class SmoothFollow : MonoBehaviour {
// The target we are following
public Transform target;

Tutorial: Meteor in Windows using Vagrant

BEFORE YOU CONTINUE:

These days some people were discussing at meteor-talk group about running Meteor at Windows and I’ve recommended them using Vagrant. It’s a very developer-friendly piece of software that creates a virtual machine (VM) which let you run any operating system wanted and connect to it without big efforts of configuration (just make the initial installation and you have it working).

Many packages (I've tested) for running Meteor+Vagrant fails because Meteor writes its mongodb file and also other files inside local build folder into a shared folder between the Windows host and the Linux guest, and it simply does not work. So I've put my brain to work and found a solution: do symlinks inside the VM (but do not use ln. Use mount so git can follow it). It’s cove