Skip to content

Instantly share code, notes, and snippets.

View priesdelly's full-sized avatar
🏠
Working from home

Priesdelly priesdelly

🏠
Working from home
View GitHub Profile
git filter-branch - force - index-filter "git rm - cached - ignore-unmatch path/to/credential_file" - prune-empty - tag-name-filter cat - - all
package main
import (
"fmt"
"net/http"
"crypto/tls"
)
func main() {
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
package main
import (
"fmt"
"net/http"
"crypto/tls"
)
func main() {
tr := &http.Transport{
@priesdelly
priesdelly / ReplaceStringJSNew.js
Created February 24, 2019 07:13
Replace string in javascript
var strText = 'Test Replace bear and duck and dog and cat';
var strAfRep = strText.replace(/and/g,'or');
console.log(strAfRep);
@priesdelly
priesdelly / ReplaceStringJSNormal.js
Last active February 24, 2019 07:12
Replace string in javascript
var strText = 'Test Replace bear and duck and dog and cat';
var strAfRep = strText.replace('and','or');
console.log(strAfRep);
private string GetExcelColumnName(int columnNumber)
{
int dividend = columnNumber;
string columnName = String.Empty;
int modulo;
while (dividend > 0)
{
modulo = (dividend - 1) % 26;
columnName = Convert.ToChar(65 + modulo).ToString() + columnName;
@priesdelly
priesdelly / DateCultureCShapre2.cs
Last active February 24, 2019 06:28
Create 12 month via code in .NET Framework
private void Form1_Load(object sender, EventArgs e)
{
for (int monthNo = 1; monthNo < 12; monthNo++)
{
var bar = new DateTime(DateTime.Now.Year, monthNo, 1);
listBox1.Items.Add(bar.ToString("MMMM", new CultureInfo("en-US")));
listBox2.Items.Add(bar.ToString("MMMM", new CultureInfo("th-TH")));
}
}
@priesdelly
priesdelly / DateCultureCSharp.cs
Last active February 24, 2019 05:53
Date, Datetime show in other culture info
using System;
using System.Collections.Generic;
using System.Text;
// นำเข้าคลาส Globalization โดยเรียกผ่านเนมสเปช System.Globalization
// เพื่อให้สามารถเรียกใช้คลาส CultureInfo() ได้
using System.Globalization;
namespace DateCultureCSharp
{
@priesdelly
priesdelly / StringBuilder.cs
Last active February 23, 2019 09:59
Example use "System.Text.StringBuilder" in .NET framework by C# language
using System;
using System.Diagnostics;
using System.Text;
namespace StringBuilder
{
class Program
{
static void Main(string[] args)
{