This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Read-ApacheLog | |
{ | |
param( | |
[Parameter(Mandatory=$true)] | |
[string] | |
$Path | |
) | |
Get-Content -Path $Path | Foreach-Object { | |
# combined format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# White level detection script | |
# Copyright (c) 2012 Yoichi Imai <sunnyone41@gmail.com> | |
if [ -z "$1" ]; then | |
echo usage: $0 image | |
exit 1 | |
fi | |
FILE="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Replace linaria styled`` to vanilla-extract style({}) | |
text = DATA.read | |
text.gsub!(%r|const (\w+) = styled.*?`(.*?)`|m) do | |
name = $1 | |
css = $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Replace linaria css`` to panda css({}) | |
text = DATA.read | |
text.gsub!(%r|css`(.*?)`|m) do | |
css = $1 | |
list = css.split(/;/).map do |s| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -AssemblyName presentationframework | |
[xml]$XAML = @' | |
<Window | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="100" Width="20"> | |
<StackPanel> | |
<TextBox Name="textWeather" /> | |
<Button Name="buttonGet" Content="Get"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final String command = "HELO\n"; | |
final UUID sppUuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB"); | |
BluetoothAdapter.getDefaultAdapter(); | |
if (btAdapter == null) { | |
sendLogMessage("Bluetooth adapter is not available."); | |
return; | |
} | |
sendLogMessage("Bluetooth adapter is found."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example: Set-PowerShellUICulture -Name "en-US" | |
function Set-PowerShellUICulture { | |
param([Parameter(Mandatory=$true)] | |
[string]$Name) | |
process { | |
$culture = [System.Globalization.CultureInfo]::CreateSpecificCulture($Name) | |
$assembly = [System.Reflection.Assembly]::Load("System.Management.Automation") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add to Cargo.toml | |
// [dependencies] | |
// winapi = "*" | |
// user32-sys = "*" | |
extern crate winapi; | |
extern crate user32; | |
fn from_wide_ptr(ptr: *const u16) -> String { | |
use std::ffi::OsString; | |
use std::os::windows::ffi::OsStringExt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# $Id$ | |
# ----------------------------------------------------------------------------- | |
# Auto fetch DCC SEND | |
# ----------------------------------------------------------------------------- | |
package CTCP::DCC::AutoFetch; | |
use strict; | |
use warnings; | |
use base qw(Module); | |
use Multicast; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Concurrent; | |
using System.Management.Automation; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace AwaitablePSCmdlet | |
{ | |
public class AwaitablePSCmdlet : PSCmdlet | |
{ |
NewerOlder