Skip to content

Instantly share code, notes, and snippets.

View alain-andre's full-sized avatar

Alain ANDRE alain-andre

View GitHub Profile
@alain-andre
alain-andre / base_python.md
Last active December 29, 2015 20:19
Liste des commandes de base de Python

Décalarations

String

tring = "truc"

Integer

integer = 0

Lists

list = [1, 'truc', ['apple', 'orange', 'banana']]

>>> print list[0]

1

@alain-andre
alain-andre / mongodb_commands.md
Last active June 22, 2019 21:09
Les commandes MongoDB - basé sur les cours de MongoDB.com

Insert

doc = { "name": "Smith", "age": 30, "profession": "hacker"}

db.people.insert(doc)

Select

Find, FindOne

Retrouver un seul enregistrement dans la collection users où le username est "dwight". N'afficher que le champ email.

db.users.findOne({'username': "dwight"}, {'email': true, '_id':false})
@alain-andre
alain-andre / mootools_bootstrap.js
Last active December 31, 2015 16:09
Simple and light mootools to make the bootstrap css work.
/**
* @copyright Copyright © 2013 - 2014.
* @author Alain ANDRE <wordsbybird@gmail.com> https://github.com/alain-andre
*/
/**
* Actions sur .alert
*/
var Alert = new Class({
/* @param el L'element alert */
@alain-andre
alain-andre / mongodb_specials.md
Last active May 12, 2021 08:22
Les Aggregations sous MongoDB (informations issues de leurs cours)

Aggregation

Pipeline

  • $project - Sélectionnez, remodeler - 1:1
  • $match - Filtrer - n:1
  • $group - Agréger - n:1
  • $sort - Trier - 1:1
  • $skip - Sauter - n:1
  • $limit - Limiter - n:1
  • $unwind - Découper un champ (array) - 1:n

Rollback de n étapes

rake db:rollback STEP=n

Rollback une seule migration

rake db:migrate:down VERSION=xxxxxxxxxx
@alain-andre
alain-andre / capybara cheat sheet
Created March 2, 2016 15:48 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@alain-andre
alain-andre / git-issue
Created May 30, 2016 14:25 — forked from chsh/git-issue
Create issue for GitLab and create task for Todoist same time.
#!/usr/bin/env ruby
require 'cgi'
gem 'gitlab'
gem 'todoist'
require 'gitlab'
require 'todoist'
class IssueCreator
@alain-andre
alain-andre / libimobiledevice_ifuse_Ubuntu.md
Created July 23, 2017 10:06 — forked from samrocketman/libimobiledevice_ifuse_Ubuntu.md
On Ubuntu 16.04, since iOS 10 update, libimobiledevice can't connect to my iPhone. This is my attempt to document a fix.

Why this document?

I upgraded my iPhone 5s to iOS 10 and could no longer retrieve photos from it. This was unacceptable for me so I worked at achieving retrieving my photos. This document is my story (on Ubuntu 16.04).

The solution is to compile libimobiledevice and ifuse from source.

While I did my best to think of beginners when creating this guide; This guide is not for the faint of heart. If you've not compiled software before then I recommend you practicing inside of VirtualBox before attempting this on your real system. Follow this guide at your own risk because I can't make any guarantees based on unknown individual skill level.

Support

@alain-andre
alain-andre / gist:69cc2799c571e2aa465522ab108cda9d
Created March 23, 2018 19:46 — forked from trcarden/gist:3295935
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@alain-andre
alain-andre / example.html
Created June 15, 2018 10:25 — forked from kylebarrow/example.html
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>