Skip to content

Instantly share code, notes, and snippets.

View katz's full-sized avatar

Katsuyuki Sakai katz

View GitHub Profile
@zwaldowski
zwaldowski / safari-inline-video.sh
Last active December 10, 2020 07:31
Safari Inline Video
defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
@kchenery
kchenery / raspberrydog.md
Last active January 26, 2020 07:58
Steps for setting up DataDog agent as a systemd service on a Raspberry PI

Install the requirements

sudo apt-get install sysstat

Install the agent from Datadog "from source". You'll get a command to run on the Pi that looks like this:

DD_API_KEY=0123456789abcdef0123456789abcdef sh -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/setup_agent.sh)"

Run that and wait for it to install and the agent to start running.

@nebgnahz
nebgnahz / shaper
Last active June 21, 2024 19:45
Traffic Shape using `tc` for Linux
#!/bin/bash
set -e
function usage() {
cat << EOF
USAGE:
./shaper start <interface> <bw as XXX kbit>
./shaper clear <interface>
./shaper show <interface>
EOF
@ar-android
ar-android / Api.java
Created November 10, 2016 16:59
OkHttp With RxAndroid and RxJava
public static Observable<Response> getData() {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
final OkHttpClient client = new OkHttpClient();
final Request request = new Request.Builder()
.url("https://github.com/ar-android/panfic/raw/master/Panfic/gen/com/ocit/data.json")
.get()
.addHeader("cache-control", "no-cache")
@CESARDELATORRE
CESARDELATORRE / project.json
Created June 29, 2016 17:20
Sample project.json of ASP.NET Core 1.0 RTM supporting multiple frameworks
{
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
@baywet
baywet / PublishAspNet5Website.ps1
Last active April 22, 2016 06:47
Fix of PublishAspNet5Website given by microsoft to support slots
param($websiteName, $packOutput, $slot)
#fix for the script provided here https://msdn.microsoft.com/en-us/Library/vs/alm/Build/azure/deploy-aspnet5?f=255&MSPPError=-2147217396
$website = $null;
$baseUrl = $websiteName;
if($slot -eq $null){
$website = Get-AzureWebsite -Name $websiteName
} else {
$baseUrl += "-" + $slot
$website = Get-AzureWebsite -Name $websiteName -Slot $slot
}
@palankai
palankai / specification.py
Last active February 2, 2025 17:45
Python Specification Pattern
class Specification:
def __and__(self, other):
return And(self, other)
def __or__(self, other):
return Or(self, other)
def __xor__(self, other):
return Xor(self, other)
@ouchadam
ouchadam / gist:876aa29b80752ecaaa08
Created January 25, 2016 15:18
exoplayer x86 hack
private static Pair<String, CodecCapabilities> getMediaCodecInfoInternal(CodecKey key,
MediaCodecListCompat mediaCodecList) {
String mimeType = key.mimeType;
int numberOfCodecs = mediaCodecList.getCodecCount();
boolean secureDecodersExplicit = mediaCodecList.secureDecodersExplicit();
// Note: MediaCodecList is sorted by the framework such that the best decoders come first.
Log.e("!!!", " --------- secure explicit? : " + secureDecodersExplicit);
for (int i = 0; i < numberOfCodecs; i++) {
MediaCodecInfo info = mediaCodecList.getCodecInfoAt(i);
#!/bin/sh
# Determines who is logged in and then kills SEP and relaunches sans reboot.
# Get logged in user from /dev/console
loggedInUser=`ls -l /dev/console | awk '{ print $3 }'`
if [ "$loggedInUser" != "admin" ]
then
launchctl unload /Library/LaunchDaemons/com.symantec.Sched501-1.plist
@uupaa
uupaa / end.of.browser.wars.3rd.md
Last active October 30, 2015 18:19
第三次ブラウザ戦争がそろそろ閉幕します

Chromeのシェアが50%を超え、それと相反するようにIEのシェアが低迷し、
ついにFirefoxのシェアと並びました。
(10年前なら誰も信じてくれませんね、このグラフ)

IEがシェアを失い続け、Chrome がシェアを獲得し続ける事が見えてしまっているため、
第三次ブラウザ戦争もそろそろフィナーレ、閉幕となります。

標準化から分化と特化へ