Skip to content

Instantly share code, notes, and snippets.

View kaleocheng's full-sized avatar
🦀

Kaleo kaleocheng

🦀
View GitHub Profile
@cenunix
cenunix / configuration.nix
Created June 2, 2023 07:55
X13s nixos configuration.nix
{ config, lib, pkgs, ... }:
let
linux_x13s_pkg = { buildLinux, ... } @ args:
buildLinux (args // rec {
version = "6.3.5";
modDirVersion = "6.3.5";
src = pkgs.fetchurl {
url = "https://github.com/steev/linux/archive/refs/heads/lenovo-x13s-linux-6.3.y.tar.gz";
@soundstorm
soundstorm / git-badges.html
Created February 6, 2017 13:29
Pure CSS Git-Badges
<html>
<head>
<style>
div.badge {
display: inline-block;
border-radius: .75em;
font-family: 'Dejavu Sans','Arial';
}
div.badge div {
display: inline-block;
@gauravve
gauravve / install_ansible.sh
Last active November 4, 2019 15:35
Install ansible using pip on centos7
sudo rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm
#Yum
sudo yum -y update
sudo yum install -y python-devel
sudo yum install -y openssl-devel
sudo yum install -y libffi-devel
sudo yum -y install python-pip
@chrisckchang
chrisckchang / rs-connect.js
Created April 23, 2015 05:21
replica set connection with nodejs native
/**
* MongoDB NodeJS Driver Production Connection Example
*
* Copyright (c) 2015 ObjectLabs Corporation
* Distributed under the MIT license - http://opensource.org/licenses/MIT
*/
var MongoClient = require('mongodb').MongoClient;
/**
@hvoecking
hvoecking / translate.go
Last active January 22, 2025 05:35
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@prwhite
prwhite / Makefile
Last active April 19, 2025 09:46
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@kylelemons
kylelemons / piping.go
Last active May 31, 2024 09:07 — forked from dagoof/piping.go
piping exec.Cmd in golang (example sorts all regular files under a directory by their extension)
package main
import (
"bytes"
"exec"
"log"
"os"
)
// Pipeline strings together the given exec.Cmd commands in a similar fashion