~$ sudo -i -u postgres~$ createuser -U username -W --interactive| #! /bin/sh | |
| # chkconfig: 2345 98 02 | |
| # description: PostgreSQL RDBMS | |
| # This is an example of a start/stop script for SysV-style init, such | |
| # as is used on Linux systems. You should edit some of the variables | |
| # and maybe the 'echo' commands. | |
| # | |
| # Place this file at /etc/init.d/postgresql (or |
| ;; -*- mode: emacs-lisp -*- | |
| ;; This file is loaded by Spacemacs at startup. | |
| ;; It must be stored in your home directory. | |
| (defun dotspacemacs/layers () | |
| "Configuration Layers declaration." | |
| (setq-default | |
| ;; List of additional paths where to look for configuration layers. | |
| ;; Paths must have a trailing slash (i.e. `~/.mycontribs/') | |
| dotspacemacs-configuration-layer-path '() |
| curryN = (f, n) -> | |
| if n <=1 | |
| f | |
| else | |
| (firstArg) -> | |
| curryN( | |
| -> | |
| f.apply null, [firstArg].concat Array.prototype.slice.call(arguments), | |
| n-1 | |
| ) |
| function benchmark(times, fun) { | |
| var accumulatedTime = 0; | |
| var meanTime = 0; | |
| (function measureOnce(i) { | |
| var startTime, endTime; | |
| if(i <= 0) { | |
| meanTime = accumulatedTime / times; | |
| } else { |
| class C | |
| def method_missing(name, *args) | |
| name.to_s.end_with?('=') ? instance_variable_set("@#{ name[0..-2] }", args[0]) : instance_variable_get("@#{ name }") | |
| end | |
| end |
| <?php | |
| function to_str($prefix) { | |
| $parent_str = $prefix . $this->text . PHP_EOL | |
| if(empty($this->children)) { | |
| return $parent_str; | |
| } else { | |
| return $parent_str . array_map(function($node) use ($prefix) { | |
| return $node->to_str($prefix . ' '); | |
| }, this->children).join(); |
| class A | |
| def a | |
| "a" | |
| end | |
| end | |
| module M | |
| def a | |
| "m" | |
| end |