Skip to content

Instantly share code, notes, and snippets.

View florentdestremau's full-sized avatar

Florent Destremau florentdestremau

View GitHub Profile
@niepi
niepi / osx_php_homebrew.setup.md
Created February 28, 2012 13:23
OSX PHP Homebrew Setup

install php

with mysql pgsql intl support

$ brew install php --with-apache --with-mysql --with-pgsql --with-intl

set php timezone in php ini

date.timezone = Europe/Vienna
@florentdestremau
florentdestremau / Apache-auth
Last active August 29, 2015 14:16
Enable apache auth for websites under construction
First of all, you need uapache2-utils tools.
sudo apt-get install apache2-utils
Then you add this in your virtualhost in your <Directory> tag :
#Require all granted
# you need to comment this line above to require a valid-user
AuthName "This website is not ready to go public !"
AuthType Basic
@jackcarter
jackcarter / slack_delete.py
Last active November 29, 2023 07:03
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
<?php
<<<CONFIG
packages:
- "kriswallsmith/buzz: ^0.15.0"
- "symfony/console: ^3.2@dev"
CONFIG;
// Find you token on https://api.slack.com/docs/oauth-test-tokens
use Buzz\Message\Response;
@ncuillery
ncuillery / upgrade_rn.sh
Last active March 21, 2017 09:37
Upgrade React Native on your project, using a git-like interface
# In the root directory of a project, the Git working copy must be clean:
echo "a" | react-native upgrade # Generate the current version template and overwrite all files
git add .
git commit -m "Old version" # The current version template is added to the index
npm i react-native@latest --save # Install the new version of React Native
echo "a" | react-native upgrade # Generate the new version template and overwrite all files
@bekco
bekco / ResourceOwnerGrantExtension.php
Last active May 8, 2019 06:36
How to Authenticate (Facebook, Google +, Twitter etc.) users with HWIOauthBundle and FOSOauthServerBundle from iOS, Android or third party application using API.
<?php
/**
* User: bekco (Behçet Mutlu)
* Date: 17/11/16
* Time: 17:52
*/
namespace Acme\Oauth2Bundle\Oauth\Extension;
@gp187
gp187 / webstorm-phpstorm-inotify-fix
Last active June 13, 2023 08:56
Webstorm, PHPStorm Inotify watch limit is too low
To prevent this situation it is recommended to increase the watches limit (to, say, 512K):
1. Add the following line to either /etc/sysctl.conf file or a new *.conf file (e.g. idea.conf) under /etc/sysctl.d/ directory:
fs.inotify.max_user_watches = 524288
2. Then run this command to apply the change:
sudo sysctl -p --system
And don't forget to restart your IDE.
@florentdestremau
florentdestremau / button.html
Last active January 4, 2017 11:55
Bootstrap hack to make a Confirm / Cancel button group. See the width: 4% -> 4 times the width of the first one
<div class="btn-group btn-group-justified" role="group">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default btn-lg">
&times;
</button>
</div>
<div class="btn-group" role="group" style="width: 4%;">
<button type="button" class="btn btn-success btn-lg btn-block">
Confirm ?
</button>
@florentdestremau
florentdestremau / install.sh
Last active September 7, 2018 10:19
Initial setup on a thinkpad X260. Manually installing Chrome and Phpstorm aside. Download and run
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install git zsh tig curl vim htop vlc tlp tlp-rdw build-essential automake
# Battery management
sudo tlp start
# install node js
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs