Skip to content

Instantly share code, notes, and snippets.

View zsims's full-sized avatar
😕
Confused

Zac Sims zsims

😕
Confused
View GitHub Profile
// Build d8 using:
// a) Run once
// git checkout 6f98fbe86a0d11e6c902e2ee50f609db046daf71
// gclient sync
// gn gen ./out/x64.debug
// gn gen ./out/x64.release
//
// b)
// Debug Build:
// ninja -C ./out/x64.debug d8
@terjanq
terjanq / funny.php
Last active February 23, 2023 14:46
PHPF*ck
/* system(id) */
<?=$Φ=([].Φ)[![]+![]+![]]?><?=$Χ=++$Φ?><?=$Ψ=++$Χ?><?=$Ω=++$Ψ?><?=$Ϊ=++$Ω?><?=$Ϋ=++$Ϊ?><?=$ά=++$Ϋ?><?=$έ=++$ά?><?=$ή=++$έ?><?=$ί=++$ή?><?=$ΰ=++$ί?><?=$α=++$ΰ?><?=$β=++$α?><?=$γ=++$β?><?=$δ=++$γ?><?=$ε=++$δ?><?=$ζ=++$ε?><?=$η=++$ζ?><?=$θ=++$η?><?=$ι=++$θ?><?=$κ=++$ι?><?=$λ=++$κ?><?=$μ=++$λ?><?=$ν=++$μ?><?=$ξ=++$ν?><?=$ο=++$ξ?><?=$ο=([].Φ)[![]+![]+![]]?><?=($η.$ν.$η.$θ.$Ω.$α)($έ.$Ψ)?>
<!--
Explanation:
- Some of the characters might look like alphanumeric, but they are Unicode characters.
- 'ArrayΦ' <-> [].Φ
- 1 <-> ![]
- 'a' <-> ([].Φ)[![]+![]+![]]
@daemonl
daemonl / dependency-struct-closure.go
Last active April 4, 2018 02:01
Go Dependency Injection
type UserHandlerDependencies struct {
UserDatastore
UserEnricher
}
func BuildUserHandler(deps UserHandlerDependencies) http.Handler {
return http.HandlerFunc(rw http.ResponseWriter, req *http.Request) {
// Parse Request
user, err := deps.GetUser(username)
enriched := deps.EnrichUser(user)
@nayato
nayato / Dockerfile
Last active May 8, 2023 13:36
Dockerfile for rust multistage build sample
FROM rustlang/rust:nightly as builder
WORKDIR /app/src
RUN USER=root cargo new --bin ht
COPY Cargo.toml Cargo.lock ./ht/
WORKDIR /app/src/ht
RUN cargo build --release
COPY ./ ./
RUN cargo build --release
@lox
lox / README.md
Last active December 17, 2018 23:48
Proposal for top level plugins block in pipeline.yml

Top-level plugins block in pipeline.yml

Currently plugins need to be applied to each step, which ends up being verbose and it's easy for them to get out of synch as changes are made.

I'm proposing a top level plugin block that would allow plugins to be declared that would then apply to all steps.

This would aim to solve the current pain points:

  • Version declarations need to be repeated
@magnetikonline
magnetikonline / README.md
Last active June 3, 2024 01:18
macOS - Install Git from source.

Install Git on macOS from source

A quick n' dirty Bash script to install the following:

  • autoconf, needed by Git configure.
  • git - from source.

Tested successfully under both Intel and M1 (ARM64) based architectures.

Requires as a minimum Xcode CLI tools (no need for a full install). Can be installed via the following:

@xjdrew
xjdrew / client.go
Last active June 20, 2024 07:39
golang tls client and server, require and verify certificate in double direction
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
@apacha
apacha / ApplyVersionToAssemblies.ps1
Created July 1, 2016 18:49
Replace version-number in Visual Studio Team Service Build
##-----------------------------------------------------------------------
## <copyright file="ApplyVersionToAssemblies.ps1">(c) Microsoft Corporation. This source is subject to the Microsoft Permissive License. See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. All other rights reserved.</copyright>
##-----------------------------------------------------------------------
# Look for a 0.0.0.0 pattern in the build number.
# If found use it to version the assemblies.
#
# For example, if the 'Build number format' build process parameter
# $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
# then your build numbers come out like this:
# "Build HelloWorld_2013.07.19.1"
@magnetikonline
magnetikonline / README.md
Last active June 22, 2024 13:35
Bash string manipulation cheatsheet.

Bash string manipulation cheatsheet

Assignment
Assign value to variable if variable is not already set, value is returned.

Combine with a : no-op to discard/ignore return value.
${variable="value"}
: ${variable="value"}
@mitchellh
mitchellh / setup_winrm.txt
Created June 14, 2015 19:31
Packer 0.8 Windows Example on AWS
<powershell>
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
netsh advfirewall firewall add rule name="WinRM 5985" protocol=TCP dir=in localport=5985 action=allow
netsh advfirewall firewall add rule name="WinRM 5986" protocol=TCP dir=in localport=5986 action=allow