Skip to content

Instantly share code, notes, and snippets.

View fenollp's full-sized avatar

Pierre Fenoll fenollp

View GitHub Profile
@rob-murray
rob-murray / select-next-ip.sql
Created January 8, 2013 17:31
Select the next available IP address using Postgres inet and cidr types
SELECT sub.ip FROM
(SELECT set_masklen(((generate_series(1,
(2 ^ (32 - masklen('10.10.100.0/24'::cidr)))::integer - 2) +
'10.10.100.0/24'::cidr)::inet), 32) as ip) AS sub
WHERE sub.ip NOT IN
(SELECT ip_address from ip_table)
AND sub.ip > set_masklen('10.10.100.0/24', 32)+10
AND sub.ip < set_masklen(broadcast('10.10.100.0/24')::inet, 32)-5;
@johanneswuerbach
johanneswuerbach / .travis.yml
Last active April 14, 2023 20:31
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@MickaelBergem
MickaelBergem / owncloud-docker-compose.yml
Last active August 22, 2021 23:41
Docker Compose file for setting up an ownCloud server using a PostgreSQL database
# Composition of the containers
owncloud:
image: owncloud
ports:
- 80:80
volumes_from:
- owncloud-data
links:
- postgres:owncloud-db
@ferd
ferd / app_deps.erl
Created September 23, 2012 05:33
Quick escript to generate a visualization of app dependencies in Erlang/OTP.
%%% Run with 'escript app_deps.erl'
%%% Change the path in filelib:wildcard/1 as required to capture all
%%% your dependencies.
%%%
%%% Rectangular nodes will represent library apps (no processes involved)
%%% and the circular nodes will represent regular apps. An arrow going from
%%% 'A -> B' means 'A depends on B'.
%%%
%%% This script depends on graphviz being present on the system.
-module(app_deps).
@krisys
krisys / LargeInteger.cpp
Created April 30, 2011 12:14
Multiplication of Large Numbers in C++
#include<iostream>
#include<string>
#include<sstream>
#define SIZE 700
using namespace std;
class large{
int no[SIZE];
/*
array is used to store the large number.
@tsloughter
tsloughter / e.md
Last active November 4, 2016 01:59
Erlang/OTP libraries/modules replaced by third party projects

I'm looking to collect information on why certain functionality found in Erlang/OTP is usually handled instead by a third party library in people's projects.

This could be bugs, missing functionality, poor interface, performance, etc.

Examples off the top of my head that need expanding on are:

  • httpc
  • httpd
  • http_uri
@inket
inket / heroku-youtube-dl.rb
Last active February 2, 2016 15:02
heroku-youtube-dl
# Usage:
# ruby -e "$(curl <url_to_this_raw_gist>)" https://www.youtube.com/watch?v=Jo1tjBmwuXI
youtube_url = ARGV[0]
puts "YouTube URL: #{youtube_url}"
`mkdir youtube`
Dir.chdir "youtube"
`curl https://yt-dl.org/downloads/2014.10.13/youtube-dl > youtube-dl`
@tsloughter
tsloughter / rebar3.md
Last active August 29, 2015 14:05
Rebar3

The Rebar3 Manifesto

Warning: Rebar3 works for me, probably won't work for you yet.

Rebar has been an important tool for many years and many Erlang developers, but for various reasons it has come to show it's age very quickly. The code has become overly complex, especially the transitive dependency management, and became clear to me and a few others that a partial rewrite was required.

The prevalence of rebar configs in projects meant backwards compatability was a must, however features have been both added and removed.

OTP standards