Skip to content

Instantly share code, notes, and snippets.

View jrm2k6's full-sized avatar

Jeremy Dagorn jrm2k6

View GitHub Profile

What I wish I learnt in my computer science classes?

I have attended two different universities in France. I got my bachelor degree in Computer Science in a tiny university close to my hometown. Then, I moved to a bigger city to study in an engineering school, and graduate in "Computer Science: Software and Networks". I also spent two semesters at Laval University, in French-Canada, which was a really great experience.

After two years working as a software engineer, there is a lot of things I wish I had learned at school and some other less.

Note: I have also been doing an internship in a UC university where I have seen how different studies were in the US, so this applies only to french/european school in a certain limit.

Testing

@jrm2k6
jrm2k6 / gist:2314c09b603e03c53488
Last active January 24, 2018 13:10
Typescript code convention

Formatting

spaces vs. tabs

Use only tabs for indentation. Do not use spaces. Yes, spaces would be better :), it's for historical reasons.

curly braces, control flow

  • Always put opening curly braces on new line.
  • Add a space after control flow keywords.
  • Use braces for single line ifs as well
import Data.List
-- problem 11
data Element a = Multiple a Int | Single a deriving (Show, Eq)
encodeModified :: Eq a => [a] -> [Element a]
encodeModified [] = []
encodeModified l = map (\x -> if (length x > 1) then Multiple (head x) (length x) else Single (head x)) $ group l
@jrm2k6
jrm2k6 / gist:11319953
Last active August 29, 2015 14:00
CV
import Keyboard
import Window
import Debug
(gameWidth,gameHeight) = (600,800)
(halfWidth,halfHeight) = (300,400)
type Input = {space:Bool, dir:Int, delta:Time, timestamp:Time}
type Spaceship = {x:Float, y:Float, rotation:Float}
@jrm2k6
jrm2k6 / shoot_the_rectangle.elm
Created April 21, 2014 20:40
shoot the rectangle
import Keyboard
import Window
import Debug
(gameWidth,gameHeight) = (600,800)
(halfWidth,halfHeight) = (300,400)
type Input = {space:Bool, dir:Int, delta:Time}
type Spaceship = {x:Float, y:Float, rotation:Float}
import Keyboard
import Window
(gameWidth,gameHeight) = (600,800)
(halfWidth,halfHeight) = (300,400)
type Input = {space:Bool, dir:Int, delta:Time}
type Spaceship = {x:Float, y:Float, rotation:Float}
type Ball = {x:Float, y:Float, vx:Float, vy:Float}
activity nameActivity
extra string 'lol'
extra int 1
private void displayConversation() {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (mStatusesList.size() > 1) {
mStatusesList = removeDuplicates(mStatusesList);
}
mStatusAdapter.setStatusesList(mStatusesList);
}
sqlite> SELECT _id, time FROM status WHERE feed_id = 1 ORDER BY time ASC LIMIT 50;
182|1393617844000
192|1393617851000
180|1393618371000
179|1393618444000
175|1393618595000
172|1393618631000
185|1393618732000
181|1393618830000
190|1393618882000