Skip to content

Instantly share code, notes, and snippets.

View teamgroove's full-sized avatar

René teamgroove

  • SMILEUPPS-F091BA1E67
  • -`ღ´-
View GitHub Profile
@vitorio
vitorio / mbox-unique-email-addresses.py
Created March 30, 2015 01:17
So, let's say you have an mbox full of mail and you want to get all the To: addresses out of it. And let's say you've seen a bunch of intimidating complicated examples like http://stackoverflow.com/questions/7166922/extracting-the-body-of-an-email-from-mbox-file-decoding-it-to-plain-text-regard or http://nbviewer.ipython.org/github/furukama/Mini…
# via http://stackoverflow.com/questions/14903664/determine-unique-from-email-addresses-in-maildir-folder
import mailbox
import email
mbox = mailbox.mbox('DADEOL/AOL Mail sorted/Saved.DADEOL Sent.mbox')
uniq_emails = set(email.utils.parseaddr(msg['to'])[1].lower() for msg in mbox)
for a in uniq_emails:
@mulhoon
mulhoon / Highcharts Cheat Sheet
Last active March 22, 2023 18:43
Highcharts Cheat Sheet
$('#container').highcharts({
chart: {
alignTicks: true, // When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks.
animation: true, // Set the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here.
backgroundColor: '#FFF', // The background color or gradient for the outer chart area.
borderColor: '#4572A7', // The color of the outer chart border.
borderRadius: 5, // The corner radius of the outer chart border. In export, the radius defaults to 0. Defaults to 5.
borderWidth: 0, // The pixel width of the outer chart border.
className: null, // A CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.
defaultSeriesType: 'line', // Alias of type.
@darsain
darsain / svg_sprites.md
Last active February 19, 2025 07:08
How to use SVG sprites in img[src] and css backgrounds

To make this work in CSS:

background: url('images.svg#chart');

or img:

<img src="images.svg#chart">
@subfuzion
subfuzion / curl.md
Last active June 18, 2025 13:41
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@luminarious
luminarious / static.php
Last active July 26, 2018 09:04
Getting a static site out of Cockpit CMS
<?php
use Pug; // https://github.com/pug-php/pug
use Cockpit;
require_once __DIR__.'/vendor/autoload.php'; // Composer
require_once __DIR__.'/cockpit/bootstrap.php'; // https://github.com/COCOPi/cockpit
chdir(dirname(__FILE__)); // Keep this directory if called directly or from Cockpit
//setlocale(LC_TIME, 'et_EE', 'et', 'EE', 'ET', 'Estonia');
//define('DATE_FORMAT', "%e. %B %G");
@phusick
phusick / server.js
Created November 18, 2016 11:38
Webpack Dev Server with Proxy
/* eslint-disable no-console */
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const cookieParser = require('cookie-parser');
const config = require('./webpack.config')();
const PORT = require('../../package.json').config.port;
function relayRequestHeaders(proxyReq, req) {
console.log('💥💥💥 request 💥💥💥');
package main
import (
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
_ "github.com/mattn/go-sqlite3"
)
type Users struct {
Id int `gorm:"AUTO_INCREMENT" form:"id" json:"id"`
@blakek
blakek / queryStringParse.js
Last active January 22, 2021 12:47
Parse query string in browser (<=ES5)
// Deserialize query string to object
// Example: var queryParams = queryStringParse(window.location.search)
function queryStringParse (str) {
var ret = Object.create(null)
if (typeof str !== 'string') {
return ret
}
str = str.trim().replace(/^(\?|#|&)/, '')
@bjunc
bjunc / graphql-axios.js
Last active January 12, 2024 05:34
application/graphql vs application/json using axios
let input = { first_name: 'Foo', last_name: 'Bar' };
// application/graphql example
/* eslint-disable no-unused-vars */
let configGraphQL = {
url: '/graphql',
method: 'post',
headers: { 'Content-Type': 'application/graphql' },
data: `mutation { user(id: 1, input: ${ JSON.stringify(input) }){ full_name } }`
};
@crittermike
crittermike / wget.sh
Last active June 9, 2025 16:19
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.