Skip to content

Instantly share code, notes, and snippets.

View fenollp's full-sized avatar

Pierre Fenoll fenollp

View GitHub Profile
@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.
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@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).
@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:
@ericbmerritt
ericbmerritt / Makefile
Last active August 11, 2023 09:35
Universal drop in Makefile for Erlang projects that use rebar
# Copyright 2012 Erlware, LLC. All Rights Reserved.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
@willurd
willurd / web-servers.md
Last active April 26, 2024 18:00
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@tylerneylon
tylerneylon / learn.lua
Last active April 2, 2024 15:09
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@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

@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`