Skip to content

Instantly share code, notes, and snippets.

View pachacamac's full-sized avatar
🌶️
Mmmmhmmmm

Marc pachacamac

🌶️
Mmmmhmmmm
  • Hacker/Founder
  • Germany, Berlin
View GitHub Profile
@clhenrick
clhenrick / README.md
Last active August 16, 2023 09:47
Data URI SVG icons with Leaflet
@serapath
serapath / index.html
Last active September 23, 2015 16:16
App Loader with Update Manager
<body><script>
/* SET `$appurl` as argument to the IIFE
to load any javascript (localstorage size limit 5mb)
The first page visit will load the whole script, follow-up visits
load the cached script right away and if a new version is available,
offer to update the app now or later.
(The caching only works if the server sends `header.etag`)
I welcome suggestions/questions/discussions - just drop me a message :-)
http://twitter.com/serapath
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active April 5, 2025 06:45
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@Iman
Iman / clean.sh
Last active April 23, 2025 04:33
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
/* An HTML template in 180 bytes (minified)
Features: Escapes HTML, accepts either strings or functions as values, and that's all (it doesn't handle looping).
Usage:
OneEightyT(
"<h1>{name}</h1><div>{content} @ {currentTime}</div>",
{
name: "Stella",
@O-I
O-I / extract_uri.md
Last active August 19, 2023 01:02
[TIx 3] Extracting links from text with URI::extract

I have a simple Rails app that collects all the tweets I favorite on Twitter so I can sort and search through them at my leisure. Many of those favorites contain links I'd like to refer to, so I wrote a helper method that converts them to clickable anchor tags that looked like this:

# app/helpers/favorites_helper.rb
module FavoritesHelper

  # snip
  
  def text_to_true_link(tweet_text)
 urls = tweet_text.scan(/https*:\/\/t.co\/\w+/)
import java.io.*;
DataInputStream dis;
void setup()
{
size(256, 256);
try {
dis = new DataInputStream(new FileInputStream("/home/robbe/tmp/howtodrawmushrooms.8s.raw")); // 192khz, 8 bit signed, stereo PCM
@gbuesing
gbuesing / ml-ruby.md
Last active December 3, 2024 08:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems

@nedSaf
nedSaf / map.js
Last active March 19, 2022 21:18
Get center of a layer (GeoJson) in leaflet map.
// Assuming you are inside an event (Mouseover, Click).
// Layer comes from the event.
// Get the bounds of the layer to display the popup on the north-east bounds.
var bounds = layer.getBounds();
var latLng = bounds.getCenter();
@jirutka
jirutka / pg_change_db_owner.sh
Last active February 6, 2024 20:01
Some convenient scripts to manage ownerships and privileges in PostgreSQL.
#!/bin/sh
#
# The MIT License
#
# Copyright 2014-2017 Jakub Jirutka <[email protected]>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell