Skip to content

Instantly share code, notes, and snippets.

@patmigliaccio
patmigliaccio / fatsecret_export.py
Created May 10, 2023 02:49
A simple script for exporting all FatSecret weight history to CSV.
"""
# Export FatSecret Weight History CSV
A simple script for exporting all FatSecret weight history to CSV.
## Installation
*Install Dependencies*
```sh
@AaronC81
AaronC81 / tp-link-router-ip.rb
Created April 25, 2021 14:49
Get public IP address of TP-Link router, for dynamic DNS
@gaquino
gaquino / gist:87bdf0e6e852e445c0489379d3e9732a
Last active April 15, 2024 06:52
MacOS (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools))
If you are facing an error like that on new MacOS version.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
It means that you need to install XCode command line, open a Terminal and run this command:
$ xcode-select --install
Note:
If you want to download and install Command Line tools manually, it can be downloaded from: https://developer.apple.com/download/more/
@tcaddy
tcaddy / aes-128-ecb.rb
Created March 8, 2017 16:15
Ruby AES-128-ECB encryption / decryption example. This was written to interface with a 3rd party that required string parameters to be encrypted the following way: Rinndael cipher, Electronic Code Block mode (ECB), no padding, encrypted buffer should be padded with spaces such that its length is divisible by 32.
# setup some input parameters
encrypted_decrypted = 'some string to encrypt or decrypt'
action = :encrypt # set to :encrypt or :decrypt
secret_key = 'abc123' # define shared secret key here
# encryption / decryption code...
cipher = OpenSSL::Cipher.new('AES-128-ECB')
if action == :decrypt
cipher.key = [secret_key].pack('H*')
cipher.padding = 0
@dennisreimann
dennisreimann / Main.elm
Last active April 2, 2024 20:17
A reaction to the article "A small dive into, and rejection of, Elm"
{-
This file is a reaction to the article "A small dive into, and rejection of, Elm":
https://hackernoon.com/a-small-dive-into-and-rejection-of-elm-8217fd5da235#.9w3ml4r6b
I think constructive criticism is very welcome in the Elm community. Pointing out
possibilities for documentation improvements, mentioning missing features or ways
in which the language could evolve etc. are imho a vital part of a good community.
However, the article above is neither well informed nor constructive. IMHO ranting
@btipling
btipling / connect.rs
Created December 27, 2015 23:57 — forked from mathieulegrand/connect.rs
simple connect to server:443 in Rust
// Rust 0.10-pre (Tue Mar 18, 2014)
// $ rustc -L rust-openssl/build/ -L rust-toml/lib doing.rs
// assuming https://github.com/sfackler/rust-openssl is cloned and compiled,
// and https://github.com/mneumann/rust-tom is cloned and compiled
#[feature(macro_rules)];
#[allow(deprecated_owned_vector)];
extern crate openssl;
extern crate serialize;
@mehowte
mehowte / gist:08f7e842b393efd583a1
Created March 4, 2015 13:16
Why I'm speaking at Wroc_love.rb despite their lack of Code of Conduct
I'm a speaker at [Wroc_love.rb](http://www.wrocloverb.com/).
 
Personally I would prefer the place to be more inclusive But I won't
support bullying the organizers into making decisions against their will.
 
Making the conference (especially virtually non-profit one like
wroc_love.rb) is a huge amount of work And I know that because I've been
selecting diverse set of speakers for two Railsberry conferences before it
was even cool.
 
@denji
denji / golang-tls.md
Last active February 26, 2025 16:11 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@ismasan
ismasan / sse.go
Last active February 27, 2025 00:15
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// 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
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
@mathieulegrand
mathieulegrand / connect.rs
Last active March 10, 2018 19:57
simple connect to server:443 in Rust
// Rust 0.10-pre (Tue Mar 18, 2014)
// $ rustc -L rust-openssl/build/ -L rust-toml/lib doing.rs
// assuming https://github.com/sfackler/rust-openssl is cloned and compiled,
// and https://github.com/mneumann/rust-tom is cloned and compiled
#[feature(macro_rules)];
#[allow(deprecated_owned_vector)];
extern crate openssl;
extern crate serialize;