Skip to content

Instantly share code, notes, and snippets.

View jiripospisil's full-sized avatar
🦖

Jiri Pospisil jiripospisil

🦖
View GitHub Profile
func offset(tz string) int {
if seconds, ok := timeZone[tz]; ok {
return seconds
}
log.Println("unknown time zone:", tz)
return 0
}
package main
import "fmt"
type Opicak struct {
Name string
Age int
}
func (b Opicak) PrettyName() string {
# /root/learning-manifests/break_ssh.pp
package { 'openssh-server':
ensure => present,
before => File['/etc/ssh/sshd_config'],
}
file { '/etc/ssh/sshd_config':
ensure => file,
mode => 600,
source => '/root/learning-manifests/sshd_config',
file {"/tmp/testfile2/yes":
ensure => present,
content => "well hello there"
}
file {"/tmp/testfile2":
ensure => directory,
mode => 0644
}
tux@tuxhost /tmp % time ./a.out
50005000
./a.out 0.06s user 0.44s system 120% cpu 0.417 total
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <thread>
int main(int argc, const char** argv)
{
std::mutex value_mutex;
std::vector<std::thread> threads;
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <thread>
int main(int argc, const char** argv)
{
std::mutex value_mutex;
std::vector<std::thread> threads;
# Rails 3.2.9 & 3.2.10
irb(main):001:0> Notification::Builder
=> ActiveRecord::Associations::Builder
irb(main):002:0> 'Notification::Builder'.constantize
=> Notification::Builder
irb(main):003:0> Notification::Builder
=> Notification::Builder
# Rails 4.0.0.beta (cb2b4)
irb(main):001:0> Notification::Builder
tux@tuxhost /tmp/rails-issue-8684 (master) % rails s
=> Booting WEBrick
=> Rails 4.0.0.beta application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-01-02 15:16:10] INFO WEBrick 1.3.1
[2013-01-02 15:16:10] INFO ruby 1.9.3 (2012-11-10) [x86_64-linux]
[2013-01-02 15:16:10] INFO WEBrick::HTTPServer#start: pid=5154 port=3000