Skip to content

Instantly share code, notes, and snippets.

View azhe403's full-sized avatar
๐Ÿ˜
On Error Resume Next

Azhe Kun azhe403

๐Ÿ˜
On Error Resume Next
View GitHub Profile
/// <summary>
/// ๅฐ†DataTableๆ•ฐๆฎๅฏผๅ…ฅๅˆฐexcelไธญ
/// </summary>
/// <param name="data">่ฆๅฏผๅ…ฅ็š„ๆ•ฐๆฎ</param>
/// <param name="isColumnWritten">DataTable็š„ๅˆ—ๅๆ˜ฏๅฆ่ฆๅฏผๅ…ฅ</param>
/// <param name="sheetName">่ฆๅฏผๅ…ฅ็š„excel็š„sheet็š„ๅ็งฐ</param>
/// <returns>ๅฏผๅ…ฅๆ•ฐๆฎ่กŒๆ•ฐ(ๅŒ…ๅซๅˆ—ๅ้‚ฃไธ€่กŒ)</returns>
public int DataTableToExcel(DataTable data, string sheetName, bool isColumnWritten)
{
int i = 0;
@juampynr
juampynr / guzzle_post.php
Last active May 1, 2023 19:52
Sample POST request with Guzzle
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client([
'base_uri' => 'http://example.com',
]);
@thenadz
thenadz / C# Registry Watcher Class
Last active January 28, 2025 13:45
Class to monitor one or more registry values and notify when value changes.
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
public class Program
{
private const string REG_KEY = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system";
@vluzrmos
vluzrmos / compat_l5.php
Last active November 1, 2022 20:43
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice)
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
@mul14
mul14 / 00_etc-hosts.md
Last active April 29, 2025 10:10
/etc/hosts for Vimeo, Reddit, Imgur, GitHub, DigitalOcean, dll

Unblock Steam, Vimeo, Reddit, Imgur, GitHub, DigitalOcean, NPM, PayPal, dll

Saya support Internet Positif untuk memblokir porn, situs judi, dan hal-hal ilegal lainnya. Tapi pemerintah dan ISP sangat konyol karena tidak mengizinkan akses ke Vimeo, Reddit, Imgur, Netflix--yang mana bukanlah situs dengan konten utama ilegal.

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

@margusmartsepp
margusmartsepp / gist:d9bce523a19d0475017f
Last active June 24, 2018 00:19
C# Dictionary push and pull
public static class Extensions
{
public static bool Push<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey key, TValue value)
{
try
{
if (dictionary.ContainsKey(key))
{
dictionary[key] = value;
}
@brenopolanski
brenopolanski / install-firefox-nightly.md
Created July 30, 2014 00:34
Install Firefox Nightly in Ubuntu via PPA

via: http://www.webupd8.org/2011/05/install-firefox-nightly-from-ubuntu-ppa.html

Add the Mozilla Daily PPA (available for Ubuntu 11.04, 10.10 and 10.04) and install Firefox Nightly using the commands below:

$ [sudo] add-apt-repository ppa:ubuntu-mozilla-daily/ppa
$ [sudo] apt-get update
$ [sudo] apt-get install firefox-trunk

Since this is a daily builds PPA, it's nowhere near stable so use it at your own risk!

@anilshanbhag
anilshanbhag / hosts
Created November 21, 2013 05:47
Hosts file to prevent google / youtube ads Paste the contents into /etc/hosts file in linux / mac
127.0.0.1 3ad.doubleclick.net
127.0.0.1 ad-emea.doubleclick.net
127.0.0.1 ad-g.doubleclick.net
127.0.0.1 ad-yt-bfp.doubleclick.net
127.0.0.1 ad.3au.doubleclick.net
127.0.0.1 ad.ae.doubleclick.net
127.0.0.1 ad.au.doubleclick.net
127.0.0.1 ad.be.doubleclick.net
127.0.0.1 ad.br.doubleclick.net
127.0.0.1 ad.de.doubleclick.net
@omkz
omkz / gist:4608900
Created January 23, 2013 16:16
Memperbaiki grub rescue tanpa live cd
1. pada grub rescue>
ketik #ls
nah , setelah perintah ls akan kluar kira2 seperti ini . .
(hd0) (hd0,6) (hd0,5) (hd0,2) (hd0,1)
yang mana nih partisi File system Ubuntu nya ya?
kalo ingat sih lanjut ke langkah 2
jika tidak, gw jga lupa sebenarnya yang mana