This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# Requires: youtube_dl module | |
# Requires: ffmpeg | |
# Usage: | |
# | |
# python youtube2mp3.py <URL>, ... | |
# | |
# Example: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sequelize = require('sequelize'); | |
var sequelize = new Sequelize({ | |
dialect:"sqlite", | |
storage:"./db.sqlite", | |
}); | |
// DB Connection | |
sequelize.authenticate().then( | |
function (err) {console.log("Connection established!");}, | |
function (err) {console.log("Unable to connect!", err);} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var port = 3000; | |
var app = express(); | |
app.get('/', function(req, res) { | |
res.send('<h1>Welcome! </h1>'); | |
}); | |
app.get('/username/:user_name', function(req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var path = require('path'); | |
var port = 3000; | |
var app = express(); | |
app.set('views', path.join(__dirname, 'views')); | |
app.set('view engine', 'ejs'); | |
app.get('/', function(req, res) { | |
res.render('index', {username: 'ivanleoncz'}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
var app = express(); | |
var router = express.Router(); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({extended: true})); | |
var tasks = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Functions for obtaining network information from a system. """ | |
import subprocess as sp | |
__version__ = "v1.0" | |
__author__ = "@ivanleoncz" | |
def get_nic_ipv4(nic): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
COMMIT="d92b4247d671bc55723747a00314344a46e848e1" | |
COMMIT_ROLLBACK="807a95993b80db239bd1c24d3fbeb4bb265430be" | |
echo "[INFO]: listing files from commit $COMMIT and rolling back to $COMMIT_ROLLBACK, in 5 seconds" | |
sleep 5 | |
for file in `git show --pretty="" --name-only $COMMIT` ; do | |
echo " * $file" | |
git checkout $COMMIT_ROLLBACK $file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
global_lock = threading.Lock() | |
def write_to_file(): | |
while global_lock.locked(): | |
# Give 100ms in order to execute a next loop, if locked. | |
time.sleep(0.1) | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import faulthandler | |
faulthandler.enable() | |
# Your code starts here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On local environemnt: loaded via python-dotenv. | |
# On Cloug FUnction: defined on Environment Variables section and automatically loaded for the Cloud Function. | |
DEFAULT_MESSAGE="You haven't provided a message." |