Skip to content

Instantly share code, notes, and snippets.

View jrm2k6's full-sized avatar

Jeremy Dagorn jrm2k6

View GitHub Profile
@jrm2k6
jrm2k6 / gist:11319953
Last active August 29, 2015 14:00
CV
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

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

(env)jrm2k6 @ 08:10:07 : ~/Workspace/mozillians (master) $./manage.py test
nosetests --verbosity=1
Creating test database for alias 'default'...
Got an error creating the test database: (1044, "Access denied for user 'mozillians'@'localhost' to database 'test_mozillians'")
Type 'yes' if you would like to try deleting the test database 'test_mozillians', or 'no' to cancel: yes
Destroying old test database 'default'...
Got an error recreating the test database: (1044, "Access denied for user 'mozillians'@'localhost' to database 'test_mozillians'")
mysql> select user,host from mysql.user;
app = Flask(__name__)
assets = Environment(app)
Markdown(app, extensions=['codehilite'])
app.config.from_object(__name__)
app.config.from_object('publishr.config')
app.secret_key = 'this is my secret key'
global posts_exporter_instance
Building native extensions. This could take a while...
ERROR: Error installing travis:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:4:in `<main>'

Publishing your first npm module, from top to bottom.

Great, you have some cool code that you use for your project, and you wish everybody could see how cool you are, and how clean your code is. Lucky guy, your code can totally be extracted to a small module in javascript, perfect occasion to publish your first npm module. Your code is ready, time to package, publish and enjoy.

###Creating your user

Assuming you have npm installed of course, run npm adduser.

You will have to enter a username, name and email address. You can also sign up directly on the website.

<?php
use Dingo\Api\Auth\Provider;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Tappleby\AuthToken\AuthTokenManager;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
class AuthTokenAuthenticationProvider extends Provider {
setInterval(function() { Array.prototype.slice.call(document.querySelectorAll('[data-reactid]')).forEach(function(element) { element.style.background = 'rgba(255,0,0,0.1)'; }) }, 500)
$client = new \GuzzleHttp\Client();
$img = $client->get('http://talkingshrimp.com/ts/wp-content/uploads/2009/11/I-dunno-lol11.jpg');
$img = Image::make($img->getBody()->getContents());
header("Content-type: image/jpeg");
echo $img->response('jpg');