Skip to content

Instantly share code, notes, and snippets.

View jplagostena's full-sized avatar

Juan Lagostena jplagostena

  • Ciudad de Buenos Aires, Argentina
View GitHub Profile
@dcatanzaro
dcatanzaro / botcito_galicia.js
Last active January 26, 2024 22:36
Botcito para el Galicia
const axios = require("axios");
let lastIndexMovement = 0;
const TELEGRAM_BOTID = "";
const TELEGRAM_CHATID = "";
class Telegram {
sendTelegramMessage(message) {
const botId = TELEGRAM_BOTID;
@mavieth
mavieth / install-php-7.sh
Created May 2, 2017 01:38
Upgrade from PHP 5.X.X to PHP 7 on an AWS EC2 Linux Server
#!/bin/bash
echo "==============================="
echo "Installing PHP 7"
echo "==============================="
sudo yum install php70
echo "==============================="
echo "Installing PHP 7 additional commonly used php packages"
echo "==============================="
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
public class StreamUtils {
public static <T> Collector<T, ?, T> singletonCollector() {
@mgedmin
mgedmin / gist:9547214
Created March 14, 2014 12:59
Setting up a Jenkins slave on Linux
# This is how you add a Jenkins slave
# On master:
sudo -u jenkins -H ssh-keygen
# On slave
adduser --system --group --home=/var/lib/jenkins-slave --no-create-home --disabled-password --quiet --shell /bin/bash jenkins-slave
install -d -o jenkins-slave -g jenkins-slave /var/lib/jenkins-slave
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"