This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.qrilka.snippet | |
import net.liftweb.util.Helpers._ | |
import xml._ | |
import net.liftweb.mapper.view._ | |
import net.liftweb.http._ | |
import js.JE.JsRaw | |
import js.JsCmd | |
import js.JsCmds._ | |
import ru.qrilka.model._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(test). | |
-behaviour(gen_fsm). | |
-export([start_link/0]). | |
-export([init/1, checking/2, | |
handle_event/3, handle_sync_event/4, handle_info/3, | |
terminate/3, code_change/4]). | |
-define(TIMEOUT, 2000). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mososm2=# select * from object where id=43; | |
id | type_id | tracker_id | last_event_id | last_fail_event_id | last_fix_event_id | has_connect | last_alarm_event_id | script_version | last_voltage | |
----+---------+------------+---------------+--------------------+-------------------+-------------+---------------------+----------------+-------------- | |
43 | 1 | 27 | 4455692 | 4411048 | 4455692 | t | | TT2309 | 12.8932 | |
(1 row) | |
mososm2=# select * from object where id=43; | |
id | type_id | tracker_id | last_event_id | last_fail_event_id | last_fix_event_id | has_connect | last_alarm_event_id | script_version | last_voltage | |
----+---------+------------+---------------+--------------------+-------------------+-------------+---------------------+----------------+-------------- | |
43 | 1 | 27 | 4455692 | 4411048 | 4455692 | t | | TT2309 | 12.8932 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Network.Wai | |
import Network.Wai.Handler.Warp | |
import Network.HTTP.Types (status200) | |
import Blaze.ByteString.Builder (copyByteString) | |
import qualified Data.ByteString.UTF8 as BU | |
import Data.Monoid | |
import Data.Enumerator (Iteratee) | |
import Data.Pool | |
import qualified Database.HDBC as H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>X=rpc:call('x@qrilka-desktop',erlang,whereis,[foo]). | |
>rpc:call('x@qrilka-desktop', erlang, process_info, [X]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numberedParams :: [(String, String)] -> [String] | |
numberedParams params = map snd $ filter fst $ zipWith check "123456789" sorted | |
where | |
check ch ('$':[ch2], v) = (ch==ch2, v) | |
check ch (_, v) = (False, v) | |
sorted = sortBy (comparing fst) numbered | |
numbered = filter (\(a,b) -> a =~ ("\\$[1-9]" :: String) :: Bool) params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Yesod.Core | |
import Yesod.Content | |
import Data.ByteString (ByteString) | |
import Network.Wai.Handler.Warp (run) | |
import System.Posix.Daemonize (CreateDaemon(..), serviced, simpleDaemon) | |
1import qualified Control.Exception as C | |
import System.Posix.Syslog (syslog, Priority(Notice, Warning)) | |
data Pong = Pong |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
regenerate :: Pool Connection -> String -> String -> IO () | |
regenerate pool dir subId = do | |
inPool pool $ \conn -> do | |
let strPair = (fromSql . head) &&& ((fromSql :: SqlValue -> String) . head . tail) | |
fromDb <- filter (not . null . fst) <$> map strPair <$> | |
quickQuery' conn ("SELECT url, ext FROM f_main_playlist(?)") [toSql subId] | |
dat <- catMaybes <$> mapM (\(url, ext) -> do | |
let parsed = parseAbsoluteURI url | |
case parsed of | |
Just URI{uriAuthority=Just auth} -> do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<edittext width="200" height="300" multiline="true"> | |
<method name="_placeTextY"/> | |
<method name="init"> | |
super.init(); | |
this.getDisplayObject().childNodes[4].childNodes[0].style.overflow='auto'; | |
this.field.sprite.quirks['forcemeasurescrollheight'] = false; | |
</method> | |
</edittext> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XMonad | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Util.EZConfig (additionalKeys) | |
import XMonad.Layout.NoBorders (smartBorders) | |
import System.IO | |
import DBus.Client.Simple | |
import System.Taffybar.XMonadLog (dbusLog) | |
main = do |
OlderNewer