Skip to content

Instantly share code, notes, and snippets.

View ademar111190's full-sized avatar
Lightning Networking the Bitcoin

Ademar ademar111190

Lightning Networking the Bitcoin
  • CEO of Bitcoin
  • Itatiba
View GitHub Profile
@ademar111190
ademar111190 / gist:3224223
Created August 1, 2012 06:21
prolog sudoku solver
:- use_module(library(bounds)).
:- use_module(library(clp_distinct)).
suudoku(P) :-
Rows = [R1,R2,R3,R4,R5,R6,R7,R8,R9],
problem(P, Rows),
append_all(Rows, Vars),
vars_in(Vars, 1, 9),
Vars in 1..9,
row_constraint(Rows),
@ademar111190
ademar111190 / CustomChronometer.h
Last active October 13, 2015 06:48
CustomChronometer to ios
// CustomChronometer Copyright (C) 2012 Ademar Alves de Oliveira and jurema.la
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ademar111190
ademar111190 / paresSomaDePrimos.py
Last active December 15, 2015 17:20
encontrar dois numeros primos que somados formam um numero par maior que dois.
#!/bin/python
'''
@author ademar
encontrar os 2 primos que somados formam um numero par
'''
import sys
def getPrimeUpTo(x):
print "getting prime numbers up to", x
@ademar111190
ademar111190 / simulatedAnnealing.py
Last active February 6, 2022 19:08
Simulated Annealing Python Implementation, thanks to S. Kirkpatrick, C. D. Gelatt, M. P. Vecchi, Vlado Cerny and Antonio Carlos de Lima Júnior.
#!/usr/bin/python
__author__ = "Ademar Alves de Oliveira"
__copyright__ = "Copyright 2013, Ademar"
__credits__ = ["S. Kirkpatrick", "C. D. Gelatt", "M. P. Vecchi", "A. C. L. Junior", "Diego Queiroz"]
__license__ = "GPL"
__version__ = "1.1"
__maintainer__ = "Ademar Alves"
__email__ = "ademar111190@gmail.com"
@ademar111190
ademar111190 / .gitignore
Last active January 3, 2016 15:49
A little algorithm using genetic concepts to find a secret word.
out/*
@ademar111190
ademar111190 / restartAdbOnFedoraAsRoot.sh
Last active January 3, 2016 22:19
A simple script to restart the adb (Android Debug Bridge) on Fedora. To use it follow the steps: 1> Save the script restartAdbOnFedoraAsRoot.sh on your PC. 2> Change the ADB="/path/to/your/sdk/platform-tools" to correct path. Two ways from here: 3 a> Run as "sh restartAdbOnFedoraAsRoot.sh". 4 a> Put your root password. You also can add executabl…
#!/bin/bash
# Copyright 2014 Ademar Alves de Oliveira <ademar111190@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@ademar111190
ademar111190 / README.md
Last active August 29, 2015 13:56
Restart adb as root on linux

##Restart ADB as root a linux utilitie to android developers

##how to use

###dependencies

Your adb need be on PATH variable
You need sudo access
@ademar111190
ademar111190 / extractIcon.sh
Created February 22, 2014 04:56
extract zips files from android ui utils
#!/bin/bash
# extract zips files from android ui utils:
# http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html
# this is a GPL 3+ script
# author Ademar Alves de Oliveira <ademar111190@gmail.com>
# how to use:
# extractIcon.sh file_with_icons.zip destination/folder
#!/usr/bin/python
import sys
import argparse
import os
import re
'''
A simple script to create lower-resolution Android drawables from higher-resolution ones.
@ademar111190
ademar111190 / drc.sh
Created February 27, 2014 23:51
this is a more easy way of use the drawable_convert.py (https://gist.github.com/ademar111190/9261668) exaple of use: drc.sh image.png
#!/bin/bash
# this is a more easy way of use the drawable_convert.py
# https://gist.github.com/ademar111190/9261668
# this is a GPL 3+ script
# author Ademar Alves de Oliveira <ademar111190@gmail.com>
mkdir res res/drawable-hdpi res/drawable-mdpi res/drawable-xhdpi res/drawable-xxhdpi
mv $1 res/drawable-xxhdpi
drawable_convert.py -d res/drawable-mdpi -d res/drawable-hdpi -d res/drawable-xhdpi res/drawable-xxhdpi/$1