Skip to content

Instantly share code, notes, and snippets.

View eccstartup's full-sized avatar
🈲
I may be slow to respond.

Yi Lu eccstartup

🈲
I may be slow to respond.
View GitHub Profile
<23:03:09>-eccstartup:~$ pip -V
pip 7.0.3 from /usr/local/lib/python2.7/site-packages (python 2.7)
<23:03:14>-eccstartup:~$ pip list --outdated -v
Checking in /usr/local/lib/python2.7/site-packages for .svn (svn)...
Checking in /usr/local/lib/python2.7/site-packages for .git (git)...
Checking in /usr/local/lib/python2.7/site-packages for .hg (hg)...
Checking in /usr/local/lib/python2.7/site-packages for .bzr (bzr)...
Checking in /usr/local/lib/python2.7/site-packages for .svn (svn)...
Checking in /usr/local/lib/python2.7/site-packages for .git (git)...
Checking in /usr/local/lib/python2.7/site-packages for .hg (hg)...
1312414124532675478362532543571329085712389578957198523598236057236457230478923749028357328974892375829037589230748923569823604327894723589072389547328957238907523895789207589230758932758903274892305692803567892037145892137580927389573289475238956729803659028375892037698023716891205237509812759807589263108972589236589237489326589325790238502156728013523809759823
eccstartup@Lus-MacBook-Air:~$ brew install ghc
Warning: ghc-7.8.4 already installed
eccstartup@Lus-MacBook-Air:~$ brew install ghc --devel
Error: ghc-7.8.4 already installed
To install this version, first `brew unlink ghc'
eccstartup@Lus-MacBook-Air:~$ brew unlink ghc
Unlinking /usr/local/Cellar/ghc/7.8.4... 17 symlinks removed
eccstartup@Lus-MacBook-Air:~$ brew install ghc --devel
==> Downloading https://downloads.haskell.org/~ghc/7.10.1-rc2/ghc-7.10.0.20150123-src.tar.xz
Already downloaded: /Users/eccstartup/Library/Caches/Homebrew/ghc-7.10.1-rc2.tar.xz
module MyMacros
export @map, @apply, @filter, @foldr, @foldr1, @foldl, @foldl1, @nobrace, @nobrace1
macro map(f, args...)
quote
map($f,$(args...))
end
end
@eccstartup
eccstartup / config
Created January 7, 2015 12:51
cabal config files
-- This is the configuration file for the 'cabal' command line tool.
-- The available configuration options are listed below.
-- Some of them have default values listed.
-- Lines (like this one) beginning with '--' are comments.
-- Be careful with spaces and indentation because they are
-- used to indicate layout for nested sections.
module Sqrt () where
import Data.List
data MyDouble = MD Integer [Integer]
data MyDouble1 = MD1 Integer [Integer]
-- TO DO
toMyDouble :: Double -> MyDouble
toMyDouble = undefined
Resolving dependencies...
Configuring hmatrix-0.16.1.2...
Building hmatrix-0.16.1.2...
Preprocessing library hmatrix-0.16.1.2...
[ 1 of 33] Compiling Data.Packed.Internal.Signatures ( src/Data/Packed/Internal/Signatures.hs, dist/build/Data/Packed/Internal/Signatures.o )
[ 2 of 33] Compiling Data.Packed.Internal.Common ( src/Data/Packed/Internal/Common.hs, dist/build/Data/Packed/Internal/Common.o )
[ 3 of 33] Compiling Data.Packed.Internal.Vector ( src/Data/Packed/Internal/Vector.hs, dist/build/Data/Packed/Internal/Vector.o )
[ 4 of 33] Compiling Data.Packed.Internal.Matrix ( src/Data/Packed/Internal/Matrix.hs, dist/build/Data/Packed/Internal/Matrix.o )
[ 5 of 33] Compiling Numeric.Conversion ( src/Numeric/Conversion.hs, dist/build/Numeric/Conversion.o )
[ 6 of 33] Compiling Numeric.Vectorized ( src/Numeric/Vectorized.hs, dist/build/Numeric/Vectorized.o )

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

------------------------------------------------------------------------------------------------------------------------------
-- ROSE TREES, FUNCTORS, MONOIDS, FOLDABLES
------------------------------------------------------------------------------------------------------------------------------
data Rose a = a :> [Rose a] deriving Show
-- ===================================
-- Ex. 0-2
-- ===================================
  • Coders will become cheap in the near future.
  • The boomer of coders are getting old.
  • You always need to learn mathematics if you gonna be a coder.
  • Computer science is a topic who deals with fancy words and abbreviations.
  • Statistics is not pure mathematics.

You can add to this list whether you agree with these or not, because it is GPLv3 license.