Skip to content

Instantly share code, notes, and snippets.

View aluink's full-sized avatar

Eric Polino aluink

  • Nurx / Thirty Madison
  • Chattanooga, TN
View GitHub Profile
import Ember from 'ember';
import $ from 'jquery';
const GOOGLE_KEY = 'AIzaSyCjBOhlC7914uPrWPffPIHZO8mTzcgtkow';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
output: "output is here",
actions: {
async go() {

Keybase proof

I hereby claim:

  • I am aluink on github.
  • I am aluink (https://keybase.io/aluink) on keybase.
  • I have a public key whose fingerprint is F4BC 9778 05A2 E0A9 893F 32C4 868C BB95 A4AF A681

To claim this, I am signing this object:

@aluink
aluink / MergeList1.hs
Created October 5, 2012 20:29 — forked from snluu/MergeList1.cs
In Haskell
merge :: Ord a => [a] -> [a] -> [a]
merge [] l2 = l2
merge l1 [] = l1
merge xx@(x:xs) yy@(y:ys) = if x < y then x : merge xs yy
else y : merge xx ys
@aluink
aluink / gist:2046674
Created March 15, 2012 20:25
Subsums
import Data.List
f :: (Ord a,Num a) => [a] -> Bool
f lst = (\y -> elem y $ map sum $ subsequences $ [ x | x <- lst, x /= y ]) $ maximum lst
@aluink
aluink / gist:1886870
Created February 22, 2012 19:50
Java collection evolution
//How it started
Type [] col = getCol();
for(int i = 0;i < col.length;i++){
Type obj = col[i];
//Use obj
}
//Enter untyped collections
//This is worse than before, IMO
//since you blindly cast to Type
import Data.FileStore.Git
import Data.FileStore.Types
main :: IO ()
main = do
initialize fs
save fs "testfile" a "some stuff" "some data"
where
fs = gitFileStore "./testdir"
a = Author "eric" "email"
A web handler threw an exception. Details:
resources\tmpUploads\snap-4820: MoveFileEx "resources\\tmpUploads\\snap-4820" "cpackages\\yackage-0.3.0.tar.gz": permission denied (The process cannot access the file because it is being used by another process.)
store :: FilePath -> B.ByteString -> String -> String -> IO ()
store tfp bn pn pv = do
de <- doesDirectoryExist pnd
when de $ removeDirectoryRecursive pnd
Tar.unpack packageDir . Tar.read . GZip.decompress =<< LBS.readFile tfp
renameFile tfp $ cpackageDir ++ (T.unpack $ decodeUtf8 bn)
where
pnd = packageDir ++ pn ++ [pathSeparator]
------------------------------------------------------------------------------
-- | Processes each file upload in storeUploadedFile
copyUploadedFile :: MonadSnap m
=> (PartInfo, Either PolicyViolationException FilePath)
-> m UploadInfo
copyUploadedFile (pif, efn) = either l r efn
where
l e = do logError $ B.pack $ show e
return $ UploadError "unknown upload error"
r tfp = case (partFileName pif) of