Skip to content

Instantly share code, notes, and snippets.

View countnazgul's full-sized avatar

Stefan Stoichev countnazgul

View GitHub Profile
@countnazgul
countnazgul / git clone only specific branch
Last active April 17, 2022 18:35
[Clone specific branch] #terminal #git
git clone user@git-server:project_name.git -b branch_name /some/folder
@countnazgul
countnazgul / MS-DOS delete folder silently.bat
Last active April 17, 2022 18:51
[MS-DOS delete folder silently (without Y/N prompt)] #terminal
rmdir /S /Q c:\temp
@countnazgul
countnazgul / QlikView_Convert_into_Unix_Timestamp.qvs
Last active April 17, 2022 18:34 — forked from ralfbecher/QlikView_Convert_into_Unix_Timestamp.qvs
[Convert to Unix timestamp] #qlik #qlikview #qliksense #script
LET t1 = (num(timestamp#('2013-01-11 18:00:00', 'yyyy-mm-dd hh:mm:ss')) - 25569) * 86400;
LET t2 = (num(Now(1) - 25569) * 86400;
@countnazgul
countnazgul / Loop_through_all_files_in_current_folder.bat
Last active April 17, 2022 18:51
[Loop through all files in current folder] #terminal
for /r %%i in (*.txt) do echo %%i
@countnazgul
countnazgul / psftp_automate_sftp_server.bat
Last active April 17, 2022 18:54
[psftp run commands from file] #psftp #ftp #terminal
psftp username@sftp.server.com -pw password -b commands.txt
commands.txt contain all the psft commands that need to be executed like:
lcd c:\test
mget *.gz
@countnazgul
countnazgul / Qlikview_mixed_security_access
Last active April 17, 2022 18:31
[Mixed (NTNAME and User/Pass) in section access] #qlik #qlikview #qliksense #script
Section Access;
LOAD * INLINE [
ACCESS, USERID, PASSWORD, NTNAME
ADMIN , admin , admin , *
USER , * , * , DOMAIN\USERNAME
];
Section Application;
@countnazgul
countnazgul / NULLINTERPRET
Last active April 17, 2022 06:34
[Use Null values in Qlik] #qlik #qliksense #qlikview #script
SET NULLINTERPRET=NULL;
Orders:
LOAD * INLINE [
OrderID, OrderDate
112233, 1/2/2008
223344, 2/2/2008
334455, NULL
445566, NULL
556677, 3/3/2008
@countnazgul
countnazgul / QlikView_Julian_Date_Conversion.qvs
Last active April 17, 2022 06:34 — forked from ralfbecher/QlikView_Julian_Date_Conversion.qvs
[Julian Date to normal Date] Convert from Julian Date to normal Date (Gregorian) #qlik #qlikview #script
// to convert from Julian Date to normal Date (Gregorian)
// subtract the offset 2415019 (equivalent to 30.12.1899, which is day 0 in QlikView):
Date(JulianDateField - 2415019)
//You probaly have to adjust the timezone since Julian Date is in UTC.
// to convert from normal Date (Gregorian) to Julian Date
// add the offset 2415019 (equivalent to 30.12.1899, which is day 0 in QlikView):
@countnazgul
countnazgul / Mongoose filter fields.js
Last active April 17, 2022 18:54
[Filter specific fields in query] #mongo #mongoose
User.find({}, 'first last', function (err, usr) {
//Got the result, saved a few bytes of code
});
@countnazgul
countnazgul / Limit number of MongoDB query.js
Last active April 17, 2022 18:54
[Limit number of returned docs] Limit number of MongoDB query #mongo #mongoose
Posts
.find({})
.sort({})
.limit(5)
.exec(function(err, posts) {
console.log(posts)
});