Skip to content

Instantly share code, notes, and snippets.

View artyuum's full-sized avatar
🎯
Focusing

Dynèsh Hassanaly artyuum

🎯
Focusing
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
@stankusl
stankusl / excerpt.md
Created May 27, 2015 15:07
Text Excerpt PHP function

Function:

function shorten_text($text, $max_length = 140, $cut_off = '...', $keep_word = false)
{
    if(strlen($text) <= $max_length) {
        return $text;
    }

if(strlen($text) > $max_length) {

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

@jameswomack
jameswomack / gulp.namespaces.js
Created May 5, 2015 16:17
Using Namespaces in Gulp 4
/*
* Gulp augmentation
*/
function getTasks(){
return gulp._registry._tasks;
}
function getTaskNamesInNamespace(namespace){
var tasks = getTasks();
var taskNames = Object.keys(tasks);
@Magicalex
Magicalex / service-rtorrent.sh
Last active March 28, 2020 23:49
script init.d/rtorrent
#!/usr/bin/env bash
# Dépendance : screen, killall et rtorrent
### BEGIN INIT INFO
# Provides: <username>-rtorrent
# Required-Start: $syslog $network
# Required-Stop: $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
@danielpuglisi
danielpuglisi / fuck-you-postgres.sh
Created November 11, 2014 09:06
Fuck You Postgres
#!/bin/bash
#
# Fix postgres after OSX crashed
pg_resetxlog /usr/local/var/postgres
rm /usr/local/var/postgres/postmaster.pid
pg_resetxlog /usr/local/var/postgres
pg_resetxlog -f /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@ItsAdventureTime
ItsAdventureTime / .rtorrent.rc
Created August 8, 2014 20:03
This an optimized version of the rTorrent configuration file.
#
#
# The Seedbox From Scratch Script
# By Notos ---> https://github.com/Notos/
#
#
######################################################################
#
# Copyright (c) 2013 Notos (https://github.com/Notos/)
#
@weapp
weapp / nginx.conf
Created August 4, 2014 17:21
Return common errors as json in Nginx
error_page 500 /500.html;
location /500.html{
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}';
}
error_page 502 /502.html;
location /502.html{
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';
}
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
<?php
function array_keys_multi(array $array)
{
$keys = array();
foreach ($array as $key => $value) {
$keys[] = $key;
if (is_array($array[$key])) {
$keys = array_merge($keys, array_keys_multi($array[$key]));