Skip to content

Instantly share code, notes, and snippets.

@zanbaldwin
zanbaldwin / README.md
Last active January 4, 2024 12:17
Onefetch Git Information on `cd`

Show Git Information when cding into a Git repository

  1. Install onefetch by either:
    • Compiling it from scratch using the Rust compiler, Cargo: with the command cargo install onefetch
    • Downloading a pre-built binary from Onefetch's GitHub releases page (recommended) and placing it in your $PATH (such as /usr/local/bin/onefetch).
  2. Add the snippet listed in onefetch_on_cd.sh to whatever file that gets run whenever you start a new Bash session. This differs per distro but common files include:
    • ~/.bashrc
    • ~/.bash_profile
    • sometimes ~/.bash_aliases?
@velizarn
velizarn / ip6tables_setup.bash
Last active July 11, 2024 12:52
Basic setup for ip6tables - drop all traffic except local, ICMP and DHCPv6 traffic.
#!/bin/bash
# http://serverfault.com/questions/410321/debian-ip6tables-rules-setup-for-ipv6/410327#410327
# http://ipset.netfilter.org/iptables.man.html
# https://www.sixxs.net/wiki/IPv6_Firewalling
# https://www.cyberciti.biz/faq/ip6tables-ipv6-firewall-for-linux/
# https://gist.github.com/thomasfr/9712418
# https://gist.github.com/SnakeDrak/f4150f6e517e5a1d525f
# http://www.thegeekstuff.com/2011/06/iptables-rules-examples
# http://www.thegeekstuff.com/scripts/iptables-rules
@jvandijk
jvandijk / darcula.theme
Created September 15, 2015 10:46
Highlight Darcula theme
-- Theme generated by vim2theme
Description = "vim darcula"
Default = { Colour="#a9b7c6" }
Canvas = { Colour="#2b2b2b" }
Number = { Colour="#6897bb" }
Escape = { Colour="#cc7832" , Italic=true}
String = { Colour="#a5c25c" }
BlockComment = { Colour="#808080" }
@matheusoliveira
matheusoliveira / json_manipulator.sql
Last active February 17, 2024 15:14
Simple PostgreSQL functions to manipulate json objects. (Note: performance is not a concern for those functions)
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json)
RETURNS json
IMMUTABLE
LANGUAGE sql
AS $$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
FROM (
SELECT * FROM json_each(data)
UNION ALL
SELECT * FROM json_each(insert_data)
@Willianvdv
Willianvdv / exact_online_client.rb
Last active August 29, 2015 13:55
Exact api spul
require 'base64'
require 'rest_client'
class ExactOnlineClient
def xml_call topic, data=nil
if not @cookies
# Brutal login technique (as documented (-; )
url = "https://start.exactonline.nl/docs/XMLDivisions.aspx"
response = RestClient.post url, {"_UserName_" => username, "_Password_" => password}
@cookies = response.cookies
@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.