Snip2Code is shutting down.
It has been quite a ride, since 2013 when we launched our first prototype: thanks to the effort of you guys we collected more than 3 million snippets!
We are very proud to help all our users to be more efficient in their jobs, and to be the central point to share programming knowledge for everyone.
Our basic service is free, so we always survived on our own resources to give you Snip2Code.
Unfortunately, we are no more in the financial position to sustain this effort, and therefore we are announcing here our permanent shut down,
which will take place on August 1st, 2020.
Please save your private snippets using our backup function in the settings, here.
IF YOU WANT TO SAVE SNIP2CODE, PLEASE CONSIDER DOING A DONATION!
This will allow us to pay for the servers and the infrastructure. If you want to donate, Contact Us!
Tech_JA
Tech_JA
Reputation Top 1%
Jorge Augusto
37 Snippets  (12nd place)
Published
8 Channels
Created
17 Channels
Following
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
Serious 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  565  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  543  2  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  688  2  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  338  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  874  1  5  1

Nightly Development Builds

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