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
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add --all'
alias gau='git add --update'
alias gb='git branch'
alias gbd='git branch --delete '
alias gc='git commit'
alias gcm='git commit --message'
alias gcf='git commit --fixup'
alias gco='git checkout'
@mehmetgelmedi
mehmetgelmedi / fake_phone_number_Turkey.js
Created January 22, 2020 13:48
random phone number for Turkey
`${[501, 505, 506, 507, 551, 552, 553, 554, 555, 559, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549][Math.floor(Math.random() * 30)]}${Math.floor(Math.random() * 7677412) + 2322587}`
@mehmetgelmedi
mehmetgelmedi / Install package and build for nodejs
Created November 20, 2019 13:37
if you want more than this gist you can check lerna npm package
const { readdirSync, existsSync } = require('fs');
const { join, resolve } = require('path');
const cp = require('child_process');
const baseDirectory = '.'; // set base directory
const directoryPrefix = ['.']; // set without start with
const lib = resolve(__dirname, baseDirectory);
const argv = process.argv;
let directories = [];
const getDirectories = source =>
Array.from(
{
length: 49,
},
(v, k) => k + 1
)
.sort(() => Math.random() - 0.5)
.slice(0, 6)
.sort((a, b) => a - b);
@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)
2gua.rainbow-brackets
akamud.vscode-theme-onedark
alexiv.vscode-angular2-files
anseki.vscode-color
chiragpat.tomorrow-and-tomorrow-night-operator-mono-theme
christian-kohler.path-intellisense
CoenraadS.bracket-pair-colorizer
eamodio.gitlens
eg2.tslint
formulahendry.auto-close-tag
public sealed class EnumHelper<T> where T : struct, IConvertible
{
public static T ConvertEnum(string data)
{
if (!typeof(T).IsEnum)
throw new ArgumentException("T must be an enumerated type");
if (string.IsNullOrEmpty(data))
return (T)Enum.Parse(typeof(T), "None");
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
namespace Technical
{
internal class Program
{
internal enum ExpandoReturns
import java.util.concurrent.locks.ReentrantLock;
import java.lang.*;
public class HelloWorld {
private static ReentrantLock lock = new ReentrantLock();
private static int count = 0;
public static void main(String[] args) {
System.out.println(Thread.currentThread().getName());
for (int i = 0; i < 10; i++) {
new Thread("" + i){
public void run() {
@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