Skip to content

Instantly share code, notes, and snippets.

View benfavre's full-sized avatar
💻
At the office

Webdesign29 benfavre

💻
At the office
View GitHub Profile
@v0lkan
v0lkan / nginx.conf
Last active May 16, 2024 08:32
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@jmyrland
jmyrland / Dockerfile
Created May 15, 2015 13:46
Docker mounted volume removes node_modules
# Set the base image to stable version of node
FROM node:0.12.2
# Install nodemon
RUN npm install -g nodemon
# Provides cached layer for node_modules
COPY package.json /tmp/package.json
RUN cd /tmp && npm install --production
RUN mkdir -p /app && cp -a /tmp/node_modules /app/
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@escopecz
escopecz / gist:931ad49f741b6af75cb6
Last active June 29, 2020 00:17
Mautic API integration tutorial for PHP

Mautic has API to interact with other systems. There is PHP API library for faster integration to PHP projects.

Install Mautic API library with Composer

API library isn't at Packagist in time of writing this article. Good chance is the library is at Packagist in time of reading, so install it from there and skip this.

Install from GitHub repo. So to use the library as Composer package from GitHub repo your composer.json should contain:

...
@Turbo87
Turbo87 / app.js
Created February 15, 2015 04:05
webpack + font-awesome test
require('font-awesome/css/font-awesome.css');
document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>';
@tomazzaman
tomazzaman / hhvm.conf
Last active May 13, 2021 19:44
Monit configurations for commonly used services
check process hhvm with pidfile /var/run/hhvm/pid
group hhvm
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds
stop program = "/usr/sbin/service hhvm stop"
if failed unixsocket /var/run/hhvm/hhvm.sock then restart
if mem > 400.0 MB for 1 cycles then restart
if 5 restarts with 5 cycles then timeout
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@angelodlfrtr
angelodlfrtr / Countries.json
Last active August 29, 2015 14:04
Coutries in Json with lat and lng
[
{
"name": "Afghanistan",
"alpha_2_code": "AF",
"alpha_3_code": "AFG",
"numeric_code": "4",
"lat": "33",
"long": "65",
"dial_code": "+93"
},
@angelodlfrtr
angelodlfrtr / world_country_boundaries.geojson.json
Created August 6, 2014 13:47
Limite des pays du monde en geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lub
lub / leagueoflegends
Last active August 29, 2015 14:02 — forked from anonymous/leagueoflegends
Launch League of Legends, wait until it is patched, run tuxlol -> success
#!/bin/sh
# --- README ---
# adjust paths and launch command (replace playonlinux if needed)
# get tuxlol https://bitbucket.org/Xargoth/tuxlol/downloads
# get mono: apt-get install mono-runtime libmono-system-core4.0-cil
playonlinux --run "League of Legends"
until ps aux | grep -v grep | grep LolClient