Skip to content

Instantly share code, notes, and snippets.

View mehmetgelmedi's full-sized avatar
👽
Error: Property 'status' doesn't exist.

Mehmet Emin Gelmedi mehmetgelmedi

👽
Error: Property 'status' doesn't exist.
View GitHub Profile
@mehmetgelmedi
mehmetgelmedi / async-foreach.js
Last active October 7, 2018 12:01 — forked from atinux/async-foreach.js
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@mehmetgelmedi
mehmetgelmedi / TSQL-to-POCO
Created May 20, 2018 20:26 — forked from joey-qc/TSQL-to-POCO
A simple TSQL script to quickly generate c# POCO classes from SQL Server tables and views. You may tweak the output as needed. Not all datatypes are represented but this should save a bunch of boilerplate coding. USAGE: Run this query against the database of your choice. The script will loop through tables, views and their respective columns. Re…
declare @tableName varchar(200)
declare @columnName varchar(200)
declare @nullable varchar(50)
declare @datatype varchar(50)
declare @maxlen int
declare @sType varchar(50)
declare @sProperty varchar(200)
DECLARE table_cursor CURSOR FOR