Skip to content

Instantly share code, notes, and snippets.

@marchdown
marchdown / gist:994368
Created May 26, 2011 23:41
Automatically install missing packages with package.el
;; ~/.emacs.d/package.el from http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el
(when
(load
(expand-file-name "~/.emacs.d/elpa/package.el"))
(setq package-archives '(("ELPA" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")))
(package-initialize))
;; then enter the text in that file's own buffer.
(defvar github-token nil
"If non-nil, will be used as your GitHub token without checking
git-config(1).")
@marchdown
marchdown / gist:1388808
Created November 23, 2011 14:32
Lein installation problems
$ exec/lein
Downloading Leiningen now...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
curl: (22) The requested URL returned error: 404
Failed to download https://github.com/downloads/technomancy/leiningen/leiningen-2.0.0-SNAPSHOT-standalone.jar
If you have Maven installed, you can do
mvn dependency:copy-dependencies; mv target/dependency lib
See README.md for further SNAPSHOT build instructions.
logging
from functools import partial
if __name__ == '__main__':
print '''
Программа работает из интерактивной сесии (REPL'а):
>>> from lab34 import *
есть два разборщика, lab3 и lab4.
пользоваться так:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys#, re, logging
from functools import partial
if __name__ == '__main__':
print '''
Программа работает из интерактивной сесии (REPL'а):
>>> from lab34 import *
################################################################################
# Programs must be written for people to read, and only incidentally for machines to execute.
# -- Abelson & Sussman, SICP
# http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-7.html
#
# Особенно это важно для кода, который хочется обсудить, понять и поправить — т.е. практически для любого.
# Так что я буду оставлять комментарии по мере чтения, так читать проще.
# Комментарии будут _под_ соответствующими строками кода.
def function(s):
st='#'
################################################################################
# Programs must be written for people to read, and only incidentally for machines to execute.
# -- Abelson & Sussman, SICP
# http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-7.html
#
# Особенно это важно для кода, который хочется обсудить, понять и поправить — т.е. практически для любого.
# Так что я буду оставлять комментарии по мере чтения, так читать проще.
# Комментарии будут _под_ соответствующими строками кода.
def function(s):
st='#'
//http://algowiki.net
import javax.vecmath.Point3d;
public class Dijkstra {
final int MAX;
final int EDGES;
final double INFINITE = 998.0;
//http://algowiki.net
import javax.vecmath.Point3d;
public class Dijkstra {
final int MAX;
final int EDGES;
final double INFINITE = 998.0;