Skip to content

Instantly share code, notes, and snippets.

@WaYdotNET
WaYdotNET / gist:1944182
Created February 29, 2012 20:33 — forked from wisq/gist:1507733
Why I love zsh (and hate being forced to use bash)

Why I love zsh (and hate being forced to use bash)

  • Smarter completion:
  • cd tab completion -- directories only
  • bash can do this, but needs the bash-completion package, usually comes separately
  • zsh always comes with completions, why doesn't bash?
  • Filename correction during completion
  • if dir1/x exists and dir2 exists, then "dir/x<TAB>" completes to dir1/x
  • if name1 is a file and name2 is a directory with files in it, "name/<TAB>" completes to "name2/"
# it is forked from https://github.com/xijo/reverse-markdown/blob/master/reverse_markdown.rb
require 'rexml/document'
require 'benchmark'
include REXML
include Benchmark
class ReverseMarkdown
# set basic variables:
# - @li_counter: numbering list item (li) tags in an ordered list (ol)
@WaYdotNET
WaYdotNET / class.cs
Created April 17, 2012 10:59
Nustache
var listaFatture = new List<Fatture>();
listaFatture.Add(new Fatture(15, "Fattura fittizzia", DateTime.Now));
listaFatture.Add(new Fatture(0, "Fattura FOOOO", DateTime.Now));
listaFatture.Add(new Fatture(35000, "BAAARRRRR", DateTime.Now));
var obb = new obbligatori();
obb.Descrizione = "descrizione sommaria";
obb.Nome = "che bel nome : fooo {{foo}}";
obb.Fattures = listaFatture;
@WaYdotNET
WaYdotNET / foo.cs
Created April 17, 2012 22:40
Ruby vs C#
using FluentNHibernate.Mapping;
public class WebReference
{
public virtual int Id { get; private set; }
public virtual string Title { get; set; }
public virtual string SubTitle { get; set; }
public virtual string ImageSmall { get; set; }
public virtual string ImageBig { get; set; }
public virtual string DescriptionSmall { get; set; }
public virtual string DescriptionBig { get; set; }
html, body, .container, .content {
height: 100%;
}
.container, .content {
position: relative;
}
.proper-content {
padding-top: 40px; /* >= navbar height */
html, body, .container, .content {
height: 100%;
}
.container, .content {
position: relative;
}
.proper-content {
padding-top: 40px; /* >= navbar height */
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
@WaYdotNET
WaYdotNET / index.md
Created February 28, 2013 22:42 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

// jQuery.naturalWidth / jQuery.naturalHeight plugin for (already-loaded) images
// Triple-licensed: Public Domain, MIT and WTFPL license - share and enjoy!
(function($) {
function img(url) {
var i = new Image;
i.src = url;
return i;
}
<html>
<head>
<title>My first Three.js app</title>
<style>canvas { width: 100%; height: 100% }</style>
</head>
<body>
<script src="three.min.js"></script>
<script>
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 0.1, 1000);