Skip to content

Instantly share code, notes, and snippets.

View sozercan's full-sized avatar
:shipit:

Sertaç Özercan sozercan

:shipit:
View GitHub Profile
#!/usr/bin/env bash
set -u
: "${PREFIX:=/usr/local}"
PATH="${PREFIX}/go/bin:${PATH}"
if ! command -v jq > /dev/null; then
echo "Installing jq" >&2
@cpuguy83
cpuguy83 / debug.sh
Created July 31, 2023 22:51
Debugging stuff
set -e
prev_cmd=""
this_cmd=""
prev_line=""
this_line=""
debug_trap() {
prev_cmd="${this_cmd}"
this_cmd="${BASH_COMMAND}"
prev_line="${this_line}"
@alexeldeib
alexeldeib / deploy.sh
Last active October 21, 2022 22:26
AKS wasm demo
# need an ingress controller ideally
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.4.0/deploy/static/provider/cloud/deploy.yaml
# wait a bit for nginx ip allocation...
IP="$(kubectl -n ingress-nginx get svc -o jsonpath="{.status.loadBalancer.ingress[0].ip}" ingress-nginx-controller)"
# apply workloads + runtimes
kubectl apply -f wasm.yaml
curl -v http://$IP/spin/hello
@webdevsuperfast
webdevsuperfast / zsh.md
Last active April 20, 2024 21:48
Install ZSH using Homebrew and set as default shell in Linux/WSL

Install ZSH via HomeBrew

brew install zsh

Add ZSH to /etc/shells

echo $(which zsh) | sudo tee -a /etc/shells

Set ZSH as default user shell

sudo chsh -s $(which zsh) $USER

Execute Shell or just restart terminal to take effect

@anaisbetts
anaisbetts / stat-cache.js
Last active April 11, 2019 05:07
Make your Electron apps load faster, with this One Weird Trick
// Include this at the very top of both your main and window processes, so that
// it loads as soon as possible.
//
// Why does this work? The node.js module system calls fs.realpathSync a _lot_
// to load stuff, which in turn, has to call fs.lstatSync a _lot_. While you
// generally can't cache stat() results because they change behind your back
// (i.e. another program opens a file, then you stat it, the stats change),
// caching it for a very short period of time is :ok: :gem:. These effects are
// especially apparent on Windows, where stat() is far more expensive - stat()
// calls often take more time in the perf graph than actually evaluating the
diff --git a/lib/hbc/container/zip.rb b/lib/hbc/container/zip.rb
index 5425d7f..2d59064 100644
--- a/lib/hbc/container/zip.rb
+++ b/lib/hbc/container/zip.rb
@@ -1,6 +1,6 @@
class Hbc::Container::Zip < Hbc::Container::Base
def self.me?(criteria)
- criteria.file.include? 'compressed-encoding=application/zip;'
+ criteria.file.include? 'compressed-encoding=application/zip;' or 'application/zip; charset=binary'
end
@jonstodle
jonstodle / UniformWidthWrapPanel.cs
Last active April 13, 2019 21:48
A panel which arranges it's children into the specified amount of columns and stretches them to uniformly consume the whole width
using System;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace KodeFisk
{
public class UniformWidthWrapPanel : Panel
{
public UniformWidthWrapPanel()
@denvazh
denvazh / README.md
Last active March 17, 2023 16:38
Scheduled update for homebrew

Scheduled updates for homebrew

This two launchdaemon scripts provide scheduled updates and upgrade for homebrew packages.

It will run in the following way:

  • brew update every day at 12:10
  • brew upgrade every day at 12:20

How to install