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, TypeFamilies, QuasiQuotes, TemplateHaskell, GADTs, FlexibleContexts, MultiParamTypeClasses #-} | |
import Yesod | |
import Yesod.Auth | |
import Yesod.Form.Nic (YesodNic, nicHtmlField) | |
import Yesod.Auth.BrowserId (authBrowserId) | |
import Data.Text (Text) | |
import Network.HTTP.Conduit (Manager, newManager, def) | |
import Database.Persist.Sqlite (ConnectionPool, SqlPersist, runSqlPool, runMigration, createSqlitePool ) | |
import Data.Time (UTCTime, getCurrentTime) |
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, TypeFamilies, QuasiQuotes, TemplateHaskell, GADTs, FlexibleContexts, MultiParamTypeClasses #-} | |
import Yesod | |
import Yesod.Auth | |
import Yesod.Form.Nic (YesodNic, nicHtmlField) | |
import Yesod.Auth.BrowserId (authBrowserId) | |
import Data.Text (Text) | |
import Network.HTTP.Conduit (Manager, newManager, def) | |
import Database.Persist.Sqlite (ConnectionPool, SqlPersist, runSqlPool, runMigration, createSqlitePool ) | |
import Data.Time (UTCTime, getCurrentTime) |
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
*Smerdyakov* Maybe you are viewing the channel in a fundamentally different way than I am. | |
*Smerdyakov* I do _not_ view it as the clubhouse of a particular community working to create software. | |
*Smerdyakov* I view it as a general channel for people who happen to share an interest in Haskell. | |
*Smerdyakov* I think the second interpretation is the established standard for programming language IRC channels. | |
*Smerdyakov* And in that interpretation, there is no obligation/compunction to say things that promote production of software. | |
<shapr> I believe there is an obligation to say things that promote a community. | |
*Smerdyakov* And I don't. |
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 sqlite3 as lite | |
import imaplib | |
import email | |
# assume gtk is all good | |
import gnotify | |
# assume db has been setup correctly | |
def createtyrnidb(): |
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
int powerPin = 17; | |
int groundPin = 19; | |
int failcount = 0; | |
char buffer[18]; | |
void setup() { | |
Serial.begin(9600); | |
Serial.flush(); | |
pinMode(powerPin,OUTPUT); | |
pinMode(groundPin,OUTPUT); |
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
""" | |
The Arduino alarm clock asks you for the current time and the time to awake, and then waits that many minutes. | |
""" | |
# mmm, python | |
def hourscalc(hoursnow,minutesnow,hoursalarm,minutesalarm): | |
"""input is (hoursnow,minutesnow) and (hoursalarm,minutesalarm) | |
and should look like hourscalc((00,30),(07,30))""" | |
# NOW AND ALARM ARE IN MINUTES dude! |
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 Adafruit_BBIO.GPIO as GPIO | |
import time | |
pins = ["P8_12","P8_14","P8_16","P8_18","P8_20","P8_22"] | |
for p in pins: | |
GPIO.setup(p, GPIO.OUT) | |
def setnums(n): | |
listvals = [] | |
bitstring = bin(n)[2:] | |
for x in bitstring: |
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
# required apt-get install jython libcommons-logging-java libcommons-lang-java | |
import sys | |
sys.path.append('jackcess-2.0.4.jar') # assume the jackcess is in the same directory | |
sys.path.append('/usr/share/java/commons-logging-1.1.3.jar') # in case logging didn't get picked up | |
sys.path.append('/usr/share/java/commons-lang-2.6.jar') # in case lang didn't get picked up | |
from com.healthmarketscience.jackcess import * | |
from com.healthmarketscience.jackcess.util import ExportFilter | |
from com.healthmarketscience.jackcess.util import ExportUtil | |
from com.healthmarketscience.jackcess.util import SimpleExportFilter | |
import java.io |
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
from http://www.peterbe.com/plog/uniqifiers-benchmark: | |
6-core AMD @3.5GHz desktop with 16gb of RAM | |
ᐅ python uniqifiers_benchmark.py | |
* f5 2.453 | |
* f5b 2.43 | |
* f8 1.38 | |
* f10 1.504 | |
* f11 1.523 | |
f1 1.088 |
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
;;;;;;;;; lojban defuns | |
(defun lojban-gloss () "" | |
(interactive "r") | |
(shell-command-on-region (region-beginning) (region-end) | |
"cmafihe -b")) | |
(defun lojban-parse () "" | |
(interactive) | |
(shell-command-on-region (region-beginning) (region-end) | |
"jbofihe -x -b")) |
OlderNewer