Skip to content

Instantly share code, notes, and snippets.

View pin3da's full-sized avatar

Manuel Pineda pin3da

View GitHub Profile
@pin3da
pin3da / gist:671daea7eee3cd09063920d99ec38c36
Created December 21, 2018 18:17
polybar dependencies
aptitude install libcairo2-dev libxcb1-dev libxcb-util0-dev libxcb-randr0-dev libxcb-composite0-dev python-xcbgen xcb-proto libxcb-image0-dev libxcb-ewmh-dev libxcb-icccm4-dev
aptitude install libxcb-xkb-dev libxcb-xrm-dev libxcb-cursor-dev libasound2-dev libpulse-dev i3-wm libjsoncpp-dev libmpdclient-dev libcurl4-openssl-dev libiw-dev libnl-genl-3-dev
@pin3da
pin3da / 70-synaptics.conf
Last active January 10, 2017 17:22
synaptic conf
# Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
# Option "OptionName" "value"
#
Section "InputClass"
Identifier "touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
Option "TapButton1" "1"
@pin3da
pin3da / totient.cc
Created March 21, 2016 23:56
Euler's totient function
#include <bits/stdc++.h>
using namespace std;
const int MN = 100000 + 100;
bool sieve[MN];
vector<int> p;
void fillp() {
memset(sieve, 0, sizeof sieve);
@pin3da
pin3da / gist:47a97b2b4729156c7121
Created October 7, 2015 22:54
Compiling a kernel for debian.
make menuconfig
make-kpkg clean
make-kpkg --initrd kernel_image kernel_headers
dpkg -i <new_kernel>.deb
dpkg -i <new_kernel>.deb
@pin3da
pin3da / README.md
Last active August 29, 2015 14:17
How to expose data from ZMQ to HTTP server.

This is a little example of how to expose data from ZMQ applications to an HTTP server.

Components:

  • Publisher: ZMQ application that collects data of some source. Written in C.
  • Subscriber: ZMQ application subscribed to the publisher in order to listen for data and then to send it to the webserver. Written in nodejs
  • HTTP server: Server listening for POST petitions.

Timeline:

@pin3da
pin3da / README.md
Created September 22, 2014 19:27
Basic example of Open Street Maps

Install

npm install

Run

npm start

MP

@pin3da
pin3da / linear_regression.cpp
Created February 14, 2014 04:15
Linear regression by gradient descent using Armadillo library for cpp
#include <bits/stdc++.h>
#include <armadillo>
using namespace std;
using namespace arma;
const double EPS = 1e-9;
void gen_data() {
int n;
@pin3da
pin3da / Nim-BSum-wrong.cpp
Last active December 15, 2015 09:59
Soluciones Regionals 2010 :: North America - Greater NY
vector<int> to_num(int t,int base){
vector<int> ans;
while(t){
ans.push_back(t%base);
t/=base;
}
return ans;
}
int to_dec(vector<int> n,int base){
@pin3da
pin3da / 1077.cpp
Created February 13, 2013 12:30
Solution 1077 - How Many Points?
using namespace std;
#include<iostream>
#include<cmath>
#include<cstdio>
typedef long long int lint;//para no tener que escribir long long int
lint x,y,xx,yy;
lint gcd(lint a,lint b){
@pin3da
pin3da / 1007.cpp
Created October 12, 2012 03:34
Problema "Mathematically hard"
using namespace std;
#include <cmath>
#include <cstdio>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#define MP 5000001
typedef long long int i64;