- Clone this repo:
git clone [email protected]:emailwizard/emailwizard_essentials.git
- In cloned repo directory run
docker run -v
pwd:/repo -p 9800:9800 emailwizard/emailwizard.sh
- Go to http://localhost:9800
- Preview some template
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
# old rails | |
Model.find(:all, conditions: [...], order: "...") | |
default_scope | |
named_scope | |
# new rails | |
Model.where(..).order(..).where(..) | |
## |
How to connect to mysql? Normally, this would be enough:
$ mysql -uroot -p
this is simplest way. If your user is not root, than check your user name and substitute root with this username.
If you want to connect to database after login, do $ mysql -uroot -p mydbname
To apply dump, do:
$ mysql -uroot -p mydbname < dumpfile.sql
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
Using class knowledge (see ie rental code we wrote create simple class)
create a class MyRange
that has following methods:
range = MyRange.new(2,6)
range.min #=> 2
range.max #=> 6
range.to_a #=> [2,3,4,5,6]
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
def foo(a,b=nil) | |
if a.is_a? Array | |
puts "array" | |
else | |
puts a | |
puts b | |
end | |
end | |
foo([1,2,3]) |
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
// A small SSH daemon providing bash sessions | |
// | |
// Server: | |
// cd my/new/dir/ | |
// #generate server keypair | |
// ssh-keygen -t rsa | |
// go get -v . | |
// go run sshd.go | |
// | |
// Client: |
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
class Foo | |
def self.depricated | |
@depricated_meths = true | |
end | |
def self.method_added(method) | |
if @depricated_meths | |
puts "#{method} is depricated" | |
end | |
end |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"syscall" | |
) | |
func main() { |
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 'open-uri' | |
require 'lingua/stemmer' | |
stemmer= Lingua::Stemmer.new(:language => "de") | |
words = doc.css("#mw-content-text").text.gsub("\n","").gsub("|","").gsub("\d{1,}", "").split(" ").select { |w| w.length > 2 }.map { |w| w.chomp } | |
h = Hash.new { |k,v| k[v] = 0 } |
NewerOlder