Are you looking for customized advices? Click here to contact the expert!
Tech_JA
Tech_JA
Reputation Top 1%
Jorge Augusto
37 Snippets  (11st place)
Published
8 Channels
Created
17 Channels
Following
Jan 10, 2018
Last Visit
Sep 28, 2013
Registered
6450 points  (18th place)
Reputation
Top 5% Publisher
Junior Code Generator
Serious Code Generator
Senior Code Generator
Junior Publisher
Serious Publisher
Senior Publisher
Junior Topic Hub
Serious Topic Hub
Junior Trend Maker
Serious Trend Maker
Junior Influencer
Junior Judge
Serious Judge
Senior Judge
Junior Popular Coder
Senior Popular Coder
Master Popular Coder
Junior Autobiographer
Serious Autobiographer
Senior Autobiographer
Master Autobiographer
Master Famous Coder
Junior Wise Coder

Recent Snippets See all snippets by Tech_JA

public by Tech_JA created Oct 26, 2017  382  1  5  0

sqlite-sync.js


var sqlite = require('sqlite-sync'); //requiring 
 
//Connecting - if the file does not exist it will be created 
sqlite.connect('test/test.db'); 
 
//Creating table - you can run any command 
sqlite.run("CREATE TABLE COMPANYS(ID  INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL);");
 
//Inserting - this function can be sync to, look the wiki 
sqlite.insert("COMPANYS",{NAME:"My COMPANY"}, function(inserid){
	console.log(inserid);
});
 
//Updating - returns the number of rows modified - can be async too 
var rows_modified = sqlite.update("COMPANYS",{NAME:"TESTING UPDATE"},{ID:1});
 
//Create your function 
function test(a,b){
	return a+b;
}
 
//Add your function to connection 
sqlite.create_function(test);
 
// Use your function in the SQL 
console.log(sqlite.run("SELECT ID, test(NAME, ' Inc') as NAME FROM COMPANYS"));
 
// Closing connection  
sqlite.close();

					
;

public by Tech_JA created Oct 26, 2017  369  1  5  0

Get the current date and time

Get the current date and time
var datetime = "";

function getdate() {
    var currentdate = new Date();
    datetime = currentdate.getFullYear();
    datetime += "/";
    if (currentdate.getMonth() < 10) {
        datetime += "0" + currentdate.getMonth();
    } else {
        datetime = currentdate.getMonth();
    }
    datetime += "/";
    if (currentdate.getDate() < 10) {
        datetime += "0" + currentdate.getDate();
    } else {
        datetime += currentdate.getDate();
    }
    datetime += " ";
    if (currentdate.getHours() < 10) {
        datetime += " " + currentdate.getHours();
    } else {
        datetime += currentdate.getHours();
    }
    datetime += ":";
    if (currentdate.getMinutes() < 10) {
        datetime += "0" + currentdate.getMinutes();
    } else {
        datetime += currentdate.getMinutes();
    }
    datetime += ":";
    if (currentdate.getSeconds() < 10) {
        datetime += "0" + currentdate.getSeconds();
    } else {
        datetime += currentdate.getSeconds();
    }
}

getdate();
console.log("data e hora actuais: " + datetime);						
;

public by Tech_JA created Oct 26, 2017  468  1  4  0

config-highlight.cfg

https://gist.github.com/dsosby/1122904
[Obsidian]
definition-foreground = #678CB1
error-foreground = #FF0000
string-background = #293134
keyword-foreground = #93C763
normal-foreground = #E0E2E4
comment-background = #293134
hit-foreground = #E0E2E4
builtin-background = #293134
stdout-foreground = #678CB1
cursor-foreground = #E0E2E4
break-background = #293134
comment-foreground = #66747B
hilite-background = #2F393C
hilite-foreground = #E0E2E4
definition-background = #293134
stderr-background = #293134
hit-background = #000000
console-foreground = #E0E2E4
normal-background = #293134
builtin-foreground = #E0E2E4
stdout-background = #293134
console-background = #293134
stderr-foreground = #FB0000
keyword-background = #293134
string-foreground = #EC7600
break-foreground = #E0E2E4
error-background = #293134						
;

public by Tech_JA created Oct 26, 2017  228  1  4  0

Qt 5 Dark Fusion Palette

https://gist.github.com/QuantumCD/6245215
qApp->setStyle(QStyleFactory::create("Fusion"));

    QPalette darkPalette;
    darkPalette.setColor(QPalette::Window, QColor(53,53,53));
    darkPalette.setColor(QPalette::WindowText, Qt::white);
    darkPalette.setColor(QPalette::Base, QColor(25,25,25));
    darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
    darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
    darkPalette.setColor(QPalette::ToolTipText, Qt::white);
    darkPalette.setColor(QPalette::Text, Qt::white);
    darkPalette.setColor(QPalette::Button, QColor(53,53,53));
    darkPalette.setColor(QPalette::ButtonText, Qt::white);
    darkPalette.setColor(QPalette::BrightText, Qt::red);
    darkPalette.setColor(QPalette::Link, QColor(42, 130, 218));

    darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
    darkPalette.setColor(QPalette::HighlightedText, Qt::black);
    
    qApp->setPalette(darkPalette);

    qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }");											
;

public by Tech_JA created Feb 18, 2017  754  1  5  1

Nightly Development Builds

http://downloads.kicad-pcb.org/windows/nightly/                                                            						
;