Skip to content

Instantly share code, notes, and snippets.

View alexandreaquiles's full-sized avatar

Alexandre Aquiles alexandreaquiles

View GitHub Profile
@miguelmota
miguelmota / start_stream.sh
Last active August 11, 2021 17:16
MJPG-Streamer start and stop bash scripts. For 19 Jan 2014 Update - blog post: http://www.miguelmota.com/blog/raspberry-pi-camera-board-video-streaming/
#!/bin/bash
if pgrep mjpg_streamer > /dev/null
then
echo "mjpg_streamer already running"
else
LD_LIBRARY_PATH=/opt/mjpg-streamer/ /opt/mjpg-streamer/mjpg_streamer -i "input_raspicam.so -fps 15 -q 50 -x 640 -y 480" -o "output_http.so -p 9000 -w /opt/mjpg-streamer/www" > /dev/null 2>&1&
echo "mjpg_streamer started"
fi
public class Main {
static class Node {
final Object car;
final Node cdr = this;
Node(Object content) {
this.car = content;
}
@dunossauro
dunossauro / jit.py
Last active August 17, 2020 14:19
cc
"""
$ pip install numba
$ python jit.py
resultados:
$ python test_cc.py
Tempos com JIT
cc_0_jit - Min: 0.15884569298941642, Max: 0.1812134649953805, Mean: 0.16276181136781814
cc_1_jit - Min: 0.15603229100815952, Max: 0.18515240401029587, Mean: 0.16477074182126672
cc_2_jit - Min: 0.1618276800145395, Max: 0.25311970300390385, Mean: 0.17394073442847002
@ingorichter
ingorichter / listAllProjectsWithPerforceSCM.groovy
Created July 26, 2011 05:45
groovy cli script to display all jobs with a perforce scm configuration
def jobs = hudson.model.Hudson.instance.items
jobs.each { job ->
def scm = job.scm
if (scm.class.name == 'hudson.plugins.perforce.PerforceSCM') {
println "Job '${job.name}' uses the following perforce configuration"
println '-' * 80
println "P4Port: ${scm.getP4Port()}"
println "P4Client: ${scm.getP4Client()}"
println "P4User: ${scm.getP4User()}"
@rponte
rponte / macrodef-sample.xml
Created May 18, 2011 18:19
ant macrodef sample
<!-- Create migrate task -->
<macrodef name="migrate">
<attribute name="command" />
<attribute name="environment" />
<element name="extraarguments" optional="true" />
<sequential>
<echo>** Executing "migrate @{command}" on "@{environment}" environment **</echo>
<java classname="org.apache.ibatis.migration.Migrator"
failonerror="true" fork="true" classpathref="classpath">
<sysproperty key="file.encoding" value="UTF-8"/>
@klauswuestefeld
klauswuestefeld / gist:1595701
Created January 11, 2012 17:22
O Ciclo Vicioso Do Software Retranqueiro
We couldn’t find that file to show.
{
"language": {
"javascript": {
"linting.prefer": "JSHint",
"linting.usePreferredOnly": true
}
}
}
@rcaneppele
rcaneppele / JdbcTarefaDao.java
Created May 29, 2014 16:29
FJ21-Tarefas - Multiplos Datasources
@Repository
public class JdbcTarefaDao
private Connection connection;
@Autowired
@Qualifier("postgreDataSource")
private DataSource dataSource;
@PostConstruct
@rcaneppele
rcaneppele / TarefasController.java
Created May 29, 2014 21:23
FJ21-Tarefas - Bootstrap
package br.com.caelum.tarefas.controller;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
@benoitx
benoitx / Date Calc using JDK8 LocalDate.java
Created May 26, 2014 08:48
Date Calc using JDK8 LocalDate
// create or get the Holidays
final Set<LocalDate> holidays = new HashSet<LocalDate>();
holidays.add(LocalDate.parse("2006-08-28"));
//... keep adding all holidays for 2006
// create the HolidayCalendar ASSUMING that the set covers 2006!
final HolidayCalendar<LocalDate> calendar = new DefaultHolidayCalendar<LocalDate>
(holidays, LocalDate.parse("2006-01-01"), LocalDate.parse("2006-12-31"));
// register the holidays, any calculator with name "UK"