Skip to content

Instantly share code, notes, and snippets.

View JohnProg's full-sized avatar
🎯
Focusing

John Paul JohnProg

🎯
Focusing
  • Lima, Perú
View GitHub Profile
sudo apt-get install openjdk-7-jre
sudo apt-get install openjdk-7-jdk
java -version
# Download the security key for the Jenkins repository & add it to the keychain
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
# Add the Jenkins sources to apt
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
# Update the list of packages
@JohnProg
JohnProg / Dockerfile
Created May 2, 2017 02:11
Dockerfile nodejs
FROM node:latest
# Initialize
RUN mkdir -p /data/app
WORKDIR /data/app
COPY . /data/app
RUN npm install && \
package main
import (
"fmt"
"net/http"
)
const (
//user_is_authenticated = false
user_is_authenticated = true
@JohnProg
JohnProg / main.js
Created January 4, 2017 18:48
Scrapy using nodejs
const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');
request("https://news.ycombinator.com/news", function(err, resp, body) {
if(err) {
console.log(`ERROR: ${err}`);
}
console.log(`STATUS CODE: ${resp.statusCode}`);
@JohnProg
JohnProg / jwt-example.go
Created December 30, 2016 17:18
JsonWebTokens Example with generated key.
/* rewritten example of JsonWebToken example
* from https://gist.github.com/thealexcons/4ecc09d50e6b9b3ff4e2408e910beb22
* Keys are generated and packed to PEM-format at server start
* Plus some fixes and refactors
*
* My respect to thealexcons
*/
package main
import (
package main
import (
"io/ioutil"
"log"
"strings"
"net/http"
"encoding/json"
"fmt"
"time"
# Send to single device.
from pyfcm import FCMNotification
push_service = FCMNotification(api_key="put-your-key-app-here")
# Your api-key can be gotten from: https://console.firebase.google.com/project/<project-name>/settings/cloudmessaging
registration_id = "put-your-key-device-here"
message_title = "Hi john, your customized news for today is ready"
message_body = "Hope you're having fun this weekend, don't forget to check today's news"
@JohnProg
JohnProg / Appfile
Created November 8, 2016 20:51 — forked from mmazzarolo/Appfile
Simple Fastlane setup for React-Native (Android - iOS)
# iOS
app_identifier "com.myapp.app" # The bundle identifier of your app
apple_id "me@gmail.com" # Your Apple email address
team_id "1234ABCD" # Developer Portal Team ID
# Android
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "com.myapp.app" # Your Android app package
@JohnProg
JohnProg / Dockerfile
Created August 19, 2016 20:29
Dockerfile nodeJS
FROM centos:centos6
MAINTAINER nigelpoulton@hotmail.com
# Enable EPEL for Node.js
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install Node...
RUN yum install -y npm
@JohnProg
JohnProg / Dockerfile
Last active August 16, 2016 21:46
docker - python
#
# First Flask App Dockerfile
#
#
# Pull base image.
FROM centos:7.0.1406
# Build commands
RUN yum install -y python-setuptools mysql-connector-python mysql-devel gcc python-devel