Skip to content

Instantly share code, notes, and snippets.

View owulveryck's full-sized avatar

Olivier Wulveryck owulveryck

View GitHub Profile
@triceam
triceam / index.html
Created August 20, 2012 19:44
JavaScript Templating Example to show rendering techniques of JS data in HTML or XML formats.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>JSON Transform</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script>
<script type="text/javascript" src="https://raw.github.com/douglascrockford/JSON-js/master/json2.js"></script>
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet"></link>
#!/bin/sh
# default values for arguments
ssh_host="root@remarkable" # remarkable connected through USB
landscape=true # rotate 90 degrees to the right
output_path=- # display output through ffplay
format=- # automatic output format
webcam=false # not to a webcam
measure_throughput=false # measure how fast data is being transferred
@icholy
icholy / go_zsh_complete.md
Last active January 9, 2022 19:19
Zsh Tab Completion for Golang

Zsh Tab Completion for Golang

This is pretty specific to my setup but the idea can be adapted to work with pretty much anything.

Go has a flag package which makes parsing command line arguments really easy.

package main
@itsuart
itsuart / commands and configs
Last active June 29, 2022 06:12
linux essentials
to swap cmd and alt on mac keyboard:
temporarily:
echo 1|sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd
permanently:
echo options hid_apple swap_opt_cmd=1 | sudo tee -a /etc/modprobe.d/hid_apple.conf
to stop mac from heating too much:
sudo apt install macfanctld
to set dvorak and bind caps lock to ctrl:
@ynyBonfennil
ynyBonfennil / file01.go
Last active December 5, 2022 20:33
Gonum Graph Weighted Undirected Graph : Getting Started
import (
"math"
"gonum.org/v1/gonum/graph/simple"
)
func main() {
self := 0 // the cost of self connection
absent := math.Inf(1) // the wieght returned for absent edges
graph := simple.NewWeightedUndirectedGraph(self, absent)
// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Command caption reads an audio file and outputs the transcript for it.
package main
import (
"fmt"
"io"
@zznop
zznop / mem-loader.asm
Last active March 6, 2023 00:17
Fun little loader shellcode that executes an ELF in-memory using an anonymous file descriptor (inspired by https://x-c3ll.github.io/posts/fileless-memfd_create/)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Copyright (C), zznop, brandonkmiller@protonmail.com
;;;
;;; This software may be modified and distributed under the terms
;;; of the MIT license. See the LICENSE file for details.
;;;
;;; DESCRIPTION
;;;
;;; This PoC shellcode is meant to be compiled as a blob and prepended to a ELF
@tkrs
tkrs / parser.go.y
Created February 13, 2018 05:31
goyacc tutorial
%{
package main
import (
"text/scanner"
"strconv"
"strings"
"fmt"
)
type Expression interface{}
type ParenExpr struct {
@ahmetb
ahmetb / gcrgc.sh
Last active February 26, 2024 09:14
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@posener
posener / go-table-driven-tests-parallel.md
Last active March 7, 2024 16:09
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()