Skip to content

Instantly share code, notes, and snippets.

@k0001
k0001 / Main.hs
Last active August 29, 2015 14:07
{-# LANGUAGE JavaScriptFFI #-}
{- This code compiles and runs just fine -}
module Main where
import Control.Concurrent.MVar
import qualified Control.Exception as Ex
import GHCJS.Types
import GHCJS.Foreign
# nixos-rebuild test
building Nix...
building the system configuration...
these derivations will be built:
/nix/store/rp3nj1xr0i81hlajz5ld7fdwdvy9flxc-nixos-14.12.335.676e8d7.drv
building path(s) ‘/nix/store/gq44w0rr8m11lb595y5zdjnihk0bdzl4-nixos-14.12.335.676e8d7’
building /nix/store/gq44w0rr8m11lb595y5zdjnihk0bdzl4-nixos-14.12.335.676e8d7
cp: cannot stat '/etc/nixos/configuration.nix': No such file or directory
builder for ‘/nix/store/rp3nj1xr0i81hlajz5ld7fdwdvy9flxc-nixos-14.12.335.676e8d7.drv’ failed with exit code 1
error: build of ‘/nix/store/rp3nj1xr0i81hlajz5ld7fdwdvy9flxc-nixos-14.12.335.676e8d7.drv’ failed
p='8471d0f1d478xmho'
h,m=map(int,raw_input().split(':'))
i=lambda k:(k*2,11+k%6*-2)[k>5]
Q=[0]*12;Q[i(h%12)]=1;Q[i(m/5)]|=2
print''.join(int(x,16)*' '+p[~y]+'\n'*(~g%2) for x,y,g in zip(p,Q,range(12)))
Index: love_hate_api/__init__.py
===================================================================
--- love_hate_api/__init__.py (revision 3695)
+++ love_hate_api/__init__.py (working copy)
@@ -22,7 +22,7 @@
def ban_item(self, user_id, item_id):
self._save_item_feedback(user_id, item_id, BAN_VALUE)
-
+
import glob, os
from subprocess import Popen
for name in (x[:-4] for x in glob.glob('./*.jpg')):
print '%s.jpg -> %s.png' % (name, name)
cmd = 'convert -quality 85 -type optimize %s.jpg %s.png' % (name, name)
Popen(cmd.split()).wait()
os.unlink('%s.jpg' % name)
run "#{activate_environment} && python #{release_path}/scripts/make_static_i18n_js.py #{app_ini_file} #{release_path}/popserver/public/javascripts/i18n/catalogs/", :shell => 'bash'
k@k0002:~/popego_gitted$ git svn dcommit
Committing to https://svn.popego.com/private/popego/main/trunk ...
M popserver/popserver/controllers/api/items.py
Committed r3878
M amazon_configs/common/hosts
r3875 = 5f83a21460732c7a631e7d5db81929a61a853e00 (trunk)
M popserver/popserver/controllers/api/items.py
r3878 = 7872a0aa8bfda978317675acb179464eae4904f9 (trunk)
W: 18a55fd696eaed8693666e10e4026312a039fe23 and refs/remotes/trunk differ, using rebase:
:040000 040000 7e00e5a77b3a96f503d3681552042986c2b3637b e0f2c91c3582d9722e6802dbf82ae5389ee4b50f M amazon_configs
import stat
def chmodize(st_mode):
"""Return the string representation of some file's permissions
matching the ``st_mode`` integer value
"""
st_mode = int(st_mode)
# first
if stat.S_ISREG(st_mode): x = '-'
elif stat.S_ISDIR(st_mode): x = 'd'
heroes.306.hdtv-lol.r00 2008-Oct-22 23:24:46 14.3M application/octet-stream
heroes.306.hdtv-lol.r01 2008-Oct-22 23:25:27 14.3M application/octet-stream
heroes.306.hdtv-lol.r02 2008-Oct-22 23:25:08 14.3M application/octet-stream
heroes.306.hdtv-lol.r03 2008-Oct-22 23:25:22 14.3M application/octet-stream
heroes.306.hdtv-lol.r04 2008-Oct-22 23:25:30 14.3M application/octet-stream
heroes.306.hdtv-lol.r05 2008-Oct-22 23:25:38 14.3M application/octet-stream
heroes.306.hdtv-lol.r06 2008-Oct-22 23:25:37 14.3M application/octet-stream
heroes.306.hdtv-lol.r07 2008-Oct-22 23:25:36 14.3M application/octet-stream
heroes.306.hdtv-lol.r08 2008-Oct-22 23:25:35 14.3M application/octet-stream
heroes.306.hdtv-lol.r09 2008-Oct-22 23:25:05 14.3M application/octet-stream
heroes.306.hdtv-lol.nfo 2008-Oct-22 23:18:26 3.8K application/octet-stream
heroes.306.hdtv-lol.r00 2008-Oct-22 23:24:46 14.3M application/octet-stream
heroes.306.hdtv-lol.r01 2008-Oct-22 23:25:27 14.3M application/octet-stream
heroes.306.hdtv-lol.r02 2008-Oct-22 23:25:08 14.3M application/octet-stream
heroes.306.hdtv-lol.r03 2008-Oct-22 23:25:22 14.3M application/octet-stream
heroes.306.hdtv-lol.r04 2008-Oct-22 23:25:30 14.3M application/octet-stream
heroes.306.hdtv-lol.r05 2008-Oct-22 23:25:38 14.3M application/octet-stream
heroes.306.hdtv-lol.r06 2008-Oct-22 23:25:37 14.3M application/octet-stream
heroes.306.hdtv-lol.r07 2008-Oct-22 23:25:36 14.3M application/octet-stream
heroes.306.hdtv-lol.r08 2008-Oct-22 23:25:35 14.3M application/octet-stream