Skip to content

Instantly share code, notes, and snippets.

View nocubicles's full-sized avatar

Villem Heinsalu nocubicles

View GitHub Profile
package services
import (
"fmt"
"os"
"strconv"
"time"
"github.com/google/go-github/v33/github"
"github.com/nocubicles/develytica/src/models"
@nocubicles
nocubicles / .go
Created February 1, 2020 15:13
ERPNext Random Data Generator
package main
import (
"encoding/csv"
"fmt"
"math/rand"
"net/http"
"os"
"strings"
)
package main
import (
"encoding/csv"
"fmt"
"math/rand"
"net/http"
"os"
"strings"
)
DATA: it_vttp TYPE STANDARD TABLE OF VTTP WITH HEADER LINE.
SELECT * FROM vttp
INTO TABLE it_vttp
WHERE tknum = u_lv_objky.
TYPES: BEGIN OF ty_cmr_cases,
vbeln TYPE likp-vbeln,
kunnr TYPE likp-kunnr,
DATA: it_vttp TYPE STANDARD TABLE OF VTTP WITH HEADER LINE.
SELECT * FROM vttp
INTO TABLE it_vttp
WHERE tknum = u_lv_objky.
TYPES: BEGIN OF ty_cmr_cases,
vbeln TYPE likp-vbeln,
kunnr TYPE likp-kunnr,
Meteor.setInterval( function () {
productDate = Products.findOne({isItReady: false});
var timeNow = Date();
var timeNow = timeNow.toString();
var timeCreated = productDate.startOfCountdown;
var timeCreated = timeCreated.toString();
var productId = productDate._id;
console.log(timeNow + "aeg praegu")
console.log(timeCreated + "aeg millal loodi")
if (timeCreated <= timeNow) {
W20150608-10:39:57.654(3)? (STDERR)
W20150608-10:39:57.654(3)? (STDERR) /Users/villem1/.meteor/packages/meteor-tool/.1.1.3.1ymqg2k++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150608-10:39:57.655(3)? (STDERR) throw(ex);
W20150608-10:39:57.655(3)? (STDERR) ^
W20150608-10:39:57.701(3)? (STDERR) Error: Can't call yield in a noYieldsAllowed block!
W20150608-10:39:57.701(3)? (STDERR) at Function.Fiber.yield (packages/meteor/fiber_helpers.js:8:1)
W20150608-10:39:57.701(3)? (STDERR) at Function.wait (/Users/villem1/.meteor/packages/meteor-tool/.1.1.3.1ymqg2k++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:183:14)
W20150608-10:39:57.701(3)? (STDERR) at Object.Future.wait (/Users/villem1/.meteor/packages/meteor-tool/.1.1.3.1ymqg2k++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:397:10)
W2015
var logicCheck = Meteor.setInterval( function () {
productDate = Products.findOne({isItReady: false});
var timeNow = Date();
var timeNow = timeNow.toString();
var timeCreated = productDate.createdAt;
var timeCreated = timeCreated.toString();
var productId = productDate._id;
if (timeCreated <= timeNow) {
console.log("check")
Meteor.setInterval( function () {
productDate = Products.findOne({isItReady: false}); ///Thats the query
var timeNow = Date();
var timeNow = timeNow.toString();
var timeCreated = productDate.createdAt;
var timeCreated = timeCreated.toString();
var productId = productDate._id;
if (timeCreated <= timeNow) {
console.log("check")
if (msec2 <= msec) {
console.log("checking working?");
console.log (productId);
Products.update({_id: this.productId}, {$set: {isItReady: true}})