Skip to content

Instantly share code, notes, and snippets.

View Willy-Kimura's full-sized avatar
🎯
Building front-end experiences

Willy Kimura Willy-Kimura

🎯
Building front-end experiences
View GitHub Profile
@dikiwidia
dikiwidia / unique_multidim_array.php
Created July 2, 2020 14:06
Sum Array Value of Duplicate Data in PHP
<?php
/* -------------------------------------------------------------------------
Penjelasan sintaks: Digunakan untuk grouping array key "serial_no" sekaligus
mengakumulasi array key "qty" dengan "serial_no" yang sama.
---------------------------------------------------------------------------*/
$array = [
['serial_no' => '009-AZ', 'name' => 'BSI COIL Z009 1000-PCE', 'qty' => 91],
['serial_no' => '009-AZ', 'name' => 'BSI COIL Z009 1000-PCE', 'qty' => 20],
['serial_no' => '009-AZ', 'name' => 'BSI COIL Z009 1000-PCE', 'qty' => 102],
['serial_no' => '049-BZ', 'name' => 'GEM COIL Z100 0900-CSE', 'qty' => 91],
@thenadz
thenadz / C# Registry Watcher Class
Last active December 23, 2023 10:29
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";
@craigomatic
craigomatic / AvatarGenerator
Created May 30, 2015 17:39
Simple text based avatar generator for C#
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
using System.IO;
namespace craigomatic.sample
{
@mhabegger
mhabegger / RegistryHelper.cs
Created February 11, 2015 15:13
C# Registry Helper
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 SwissMediaPartners AG, Mathieu Habegger
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@glombard
glombard / ClipboardNotification.cs
Created December 16, 2013 12:34
Monitor Clipboard changes in C# using AddClipboardFormatListener / WM_CLIPBOARDUPDATE. See Clipboard class: http://msdn.microsoft.com/en-us/library/system.windows.clipboard(v=vs.110).aspx
// from: http://stackoverflow.com/questions/2226920/how-to-monitor-clipboard-content-changes-in-c
/// <summary>
/// Provides notifications when the contents of the clipboard is updated.
/// </summary>
public sealed class ClipboardNotification
{
/// <summary>
/// Occurs when the contents of the clipboard is updated.
/// </summary>
@Ciantic
Ciantic / keyboardlistener.cs
Created July 11, 2010 17:33
C# Keyboard listener
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Windows.Input;
using System.Windows.Threading;
using System.Collections.Generic;
namespace Ownskit.Utils
{