Skip to content

Instantly share code, notes, and snippets.

{
"Redux Slice": {
"scope": "typescript",
"prefix": "rdxslc",
"body": [
"import { createSlice, PayloadAction } from '@reduxjs/toolkit';",
"",
"export interface ${1:${TM_FILENAME_BASE/(.*)(\\.slice$)/${1:/pascalcase}/g}}State {",
"\t$0",
"}",
@budiadiono
budiadiono / DependencyGraph.js
Created December 25, 2022 14:48
patch for metro/src/node-haste/DependencyGraph.js (version 0.72.3)
"use strict";
var _metroFileMap = require("metro-file-map");
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
@budiadiono
budiadiono / DependencyGraph.js
Created December 25, 2022 14:33
patch for metro/src/node-haste/DependencyGraph.js (version 0.73.6)
"use strict";
var _metroFileMap = require("metro-file-map");
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
@budiadiono
budiadiono / gulpfile.js
Last active January 25, 2019 20:09
Gitbook serve with gulpjs (while wait https://github.com/GitbookIO/gitbook/issues/1379 resolved)
var browserSync = require('browser-sync').create()
var reload = browserSync.reload
var gulp = require('gulp')
var gitbook = require('gitbook')
var path = require('path')
var del = require('del')
// path of your *.md book files
var rootPath = path.join(__dirname, 'docs')
function minVersion(version) {
var $vrs = window.jQuery.fn.jquery.split('.'),
min = version.split('.'),
prevs=[];
for (var i=0, len=$vrs.length; i<len; i++) {
console.log($vrs[i], min[i], prevs[i-1]);
if (min[i] && $vrs[i] < min[i]) {
if (!prevs[i-1] || prevs[i-1] == 0)
return false;
private static int GetRoleInstanceNumber()
{
var roleInstanceId = RoleEnvironment.CurrentRoleInstance.Id;
var li1 = roleInstanceId.LastIndexOf(".");
var li2 = roleInstanceId.LastIndexOf("_");
var roleInstanceNo = roleInstanceId.Substring(Math.Max(li1, li2) + 1);
return Int32.Parse(roleInstanceNo);
}
string connectionString = // Your connection string