Skip to content

Instantly share code, notes, and snippets.

View qdequele's full-sized avatar
🏠
Working from home

Quentin de Quelen qdequele

🏠
Working from home
  • Meili
  • Paris
View GitHub Profile
echo "Installing xcode-stuff"
xcode-select --install
echo "Install Brew"
if test ! $(which brew); then
echo "Installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
brew update
const Meili = require('meilisearch')
// Credentials of your MeiliSearch Instance
const config = {
host: 'http://127.0.0.1:7700',
apiKey: 'masterKey',
}
const meili = new Meili(config)
@qdequele
qdequele / gpg_resign.sh
Created February 24, 2018 10:33
Resign all my old commits with GPG key
#!/bin/sh
cd $1
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "your@email.com" ]
then
git commit-tree -S "$@";
fi
//
// PlistHelper.swift
// Crisp-ios
//
// Created by Quentin DEQUELEN on 12/3/16.
// Copyright © 2016 qdequele. All rights reserved.
//
import Foundation
@qdequele
qdequele / logger.swift
Created February 9, 2017 09:22
Simple logger for swift
//
// logger.swift
// Crisp
//
// Created by Quentin de Quelen on 08/02/2017.
// Copyright © 2017 qdequele. All rights reserved.
//
import Foundation
@qdequele
qdequele / media_scraper.js
Last active February 9, 2017 09:23
Media title/image universal scrapper with scraperjs promised
/*
* Bundle: Helpers - Scraper
* Project: Readlist - Server
* Author: Quentin de Quelen <quentin@dequelen.me>
* Copyright: 2015, Readlist
*/
/*
*
*Need 'scraperjs & url'
@qdequele
qdequele / Random string
Created June 10, 2015 06:55
Create a random string of n chars in swift
func randomStringWithLength (len : Int) -> NSString {
let letters : NSString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
var randomString : NSMutableString = NSMutableString(capacity: len)
for (var i=0; i < len; i++){
var length = UInt32 (letters.length)
var rand = arc4random_uniform(length)
randomString.appendFormat("%C", letters.characterAtIndex(Int(rand)))
@qdequele
qdequele / Email regex method
Created June 10, 2015 06:50
How to know if string is a email with a swift regex
func isValidEmail(testStr:String) -> Bool {
let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
return emailTest.evaluateWithObject(testStr)
}
@qdequele
qdequele / Basic Object
Created June 10, 2015 06:48
How to create basic object in swift (email short exemple)
//
// email.swift
//
// Created by Quentin De Quelen on 04/06/15.
//
class Email{
var active : Bool
var paused : Bool
let label : String
@qdequele
qdequele / Hex UIColor
Created June 10, 2015 06:45
How to user hexadecimal UIColor in swift
//
// UIColor.swift
//
// Created by Quentin De Quelen on 09/06/15.
//
import UIKit
extension UIColor {
convenience init(red: Int, green: Int, blue: Int) {