Skip to content

Instantly share code, notes, and snippets.

Hadrien Blanc hadrienblanc

Block or report user

Report or block hadrienblanc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install-jemalloc-dockerfile.md

On a debian OS system

RUN apt-get update
RUN apt-get install libjemalloc-dev
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so" 
View sql.md

ORDER BY NULL

Explicitly ORDER BY After GROUP BY By default, the database sorts all 'GROUP BY col1, col2, ...' queries as if you specified 'ORDER BY col1, col2, ...' in the query as well. If a query includes a GROUP BY clause but you want to avoid the overhead of sorting the result, you can suppress sorting by specifying 'ORDER BY NULL'.

View sqllite3-dump.sql
# How to use sqlite3
```
sqlite3 db/development.sqlite3
```
```
sqlite3 db/development.sqlite3
View show_detailed_string.md
my_string.chars do |c|
  puts "%s %3d %02X" % [ c, c.ord, c.ord ]
end
View stop_all_docker_container.sh
docker stop $(docker ps -a -q) #stop all docker container
View common_mistake.md
class User < ActiveRecord::Base
 def do_something!
   self.my_attr = 123
 end

 def do_another_thing!
   my_attr = 456
 end
@hadrienblanc
hadrienblanc / config.yml
Created Apr 29, 2019
classique circle_ci rails test config file
View config.yml
# classique circle_ci rails test config file
version: 2
jobs:
build:
environment:
working_directory: ~/circleci-myapp
docker:
- image: circleci/ruby:2.5.5-node-browsers
steps:
- checkout
View merge_array_of_hashes_test_rails.md

Are you doing a array of hashes ? They merge. :/

Unless you as: :json on the test post

    post api_v1_stuff, params: params, as: :json
View reading-gitlab-sourcecode.md
You can’t perform that action at this time.