This file contains hidden or 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'); | |
const sequelizeConfig = { | |
username: "root", | |
password: "admin", | |
dialect: "mysql" | |
}; | |
const userDb = new Sequelize({...sequelizeConfig, database: 'sequelize_test_users'}); | |
const contentDb = new Sequelize({...sequelizeConfig, database: 'sequelize_test_contents'}); |
This file contains hidden or 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 http = require('http'); | |
var fs = require('fs'); | |
//server creation | |
var server = http.createServer(function(req,res){ | |
console.log("request was made: " + req.url); | |
//creating routing system for the server | |
var routeToFile = { |
This file contains hidden or 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 exec = require('child_process').exec | |
const spawn = require('child_process').spawn | |
const dockerMachine = require('dockermachine') | |
machine = { | |
cmd(cmd, cb) { | |
return exec('docker-machine ' + cmd, (error, output) => { | |
if (error) { | |
console.log("something Broke:" + error) | |
return "something Broke: " + error |
This file contains hidden or 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 { HTTP } from 'meteor/http'; | |
import { load as loadPage } from 'cheerio'; | |
const url = `http://www.gtt.to.it/cms/percorari/arrivi`; | |
Meteor.methods({ | |
getArrivals: function(stopNumber) { | |
let data = []; | |
let page = HTTP.call('GET', url, {params: { | |
palina: stopNumber, |
This file contains hidden or 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
Verifying that "foysalit.id" is my Blockstack ID. https://onename.com/foysalit |
This file contains hidden or 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
heroku accounts:add account_name --auto | |
ssh-keygen -t rsa -C "emailaddresshere" | |
# add the ssh config file with heroku config to ~/.ssh/config file | |
Host heroku.com | |
HostName heroku.com | |
IdentityFile home/username/.ssh/identity.heroku.account_name | |
IdentitiesOnly yes | |
#set new account as current |
This file contains hidden or 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
(function() { | |
var $table = jQuery('#portlet_container').find('.col-md-12').eq(6).find('table'); | |
var $rows = $table.find('tr'); | |
var Data = []; | |
function buildDate (date) { | |
var parts = date.split("/"); | |
var dt = new Date(parseInt(parts[2], 10), | |
parseInt(parts[1], 10) - 1, | |
parseInt(parts[0], 10)); |
This file contains hidden or 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
function showSpinner() { | |
console.log('showing spinner'); | |
} | |
function hideSpinner() { | |
console.log('hiding spinner'); | |
} | |
Template.Tpl.onRendered(function(){ | |
showSpinner(); |
This file contains hidden or 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
public function users() | |
{ | |
return $this->hasMany('App\User'); | |
} | |
public function tasks() | |
{ | |
return $this->hasMany('App\Task'); | |
} |
This file contains hidden or 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
<?php | |
/** | |
* class to customize dashboard of users | |
*/ | |
class CFA_dashboard{ | |
public $user_data; | |
public $username; | |
public function __construct() | |
{ |
NewerOlder