start new:
tmux
start new with session name:
tmux new -s myname
| location /resize { | |
| alias /tmp/nginx/resize; | |
| set $width 150; | |
| set $height 100; | |
| set $dimens ""; | |
| if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
| set $width $1; | |
| set $height $2; | |
| set $image_path $3; |
| Set-PSReadlineOption -BellStyle None | |
| # Clone `https://github.com/dahlbyk/posh-git.git` to C:\Gits | |
| Import-Module 'C:\Gits\posh-git\src\posh-git.psd1' | |
| set-executionpolicy Unrestricted process | |
| $baseDir = Split-Path -parent $MyInvocation.MyCommand.Definition | |
| #. "$baseDir\hand.ps1" | |
| # General actions | |
| function edit ($file) { & "${env:ProgramFiles(x86)}\Notepad++\notepad++.exe" $file } |
| class AdminFileHandler(BaseHandler): | |
| @authenticated | |
| def get(self, file_name): | |
| _file_dir = os.path.abspath("")+"/my/path/downloads" | |
| _file_path = "%s/%s" % (_file_dir, file_name) | |
| if not file_name or not os.path.exists(_file_path): | |
| raise HTTPError(404) | |
| self.set_header('Content-Type', 'application/force-download') | |
| self.set_header('Content-Disposition', 'attachment; filename=%s' % file_name) |
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Authentication proxy for Tornado to use Google apps authentication to | |
| serve the files in a protected location. Ideal to serve files like | |
| sphinx documentation behind a password. | |
| :copyright: (c) 2011 by Openlabs Technologies & Consulting (P) Limited | |
| :license: BSD, see LICENSE for more details. | |
| """ |
| import tornado.ioloop | |
| import tornado.web | |
| import tornado.escape | |
| import tornado.options | |
| import tornado.httputil | |
| import jinja2 | |
| import pyjade.compiler | |
| import coffeescript | |
| import markdown |
| from datetime import datetime | |
| import calendar | |
| def epoch_to_iso8601(timestamp): | |
| """ | |
| epoch_to_iso8601 - convert the unix epoch time into a iso8601 formatted date | |
| >>> epoch_to_iso8601(1341866722) | |
| '2012-07-09T22:45:22' | |
| """ |
| // If URL is available URL link the image | |
| // Otherwise just display the image | |
| <% if ( instagram_link_url ) { %> <a href="<%= instagram_link_url %>" target="_blank"> <% } %> | |
| <img src="<%= url %>" alt="<%= username %>" /> | |
| <% if ( instagram_link_url ) { %> </a> <% } %> | |
| // Example 2 - Check if formated date | |
| <% if (typeof(date) != "undefined") { %> | |
| <span class="date"><%= date %></span> | |
| <% } %> |
| Ondřej Čertík |
| all : a_f a_c a_c++ | |
| a_f : a.f90 | |
| gfortran -O3 -march=native -ffast-math -funroll-loops a.f90 -o a_f | |
| a_c : a.c | |
| gcc -O3 -march=native -ffast-math -funroll-loops a.c -o a_c | |
| a_c++ : a.cc | |
| g++ -O3 -march=native -ffast-math -funroll-loops a.cc -o a_c++ |