Skip to content

Instantly share code, notes, and snippets.

View mmar's full-sized avatar
🐈‍⬛

Matusalem Marques mmar

🐈‍⬛
View GitHub Profile
let a: Double? = 1.0
let b: Double? = 2.0
let c: Double? = 3.0
let d: Double? = 4.0
let e: Double? = 5.0
let f: Double? = 6.0
let g: Double? = 7.0
extension Optional {
func `or`(_ value : Wrapped?) -> Optional {
@jpallari
jpallari / writing_tech_articles.md
Last active August 13, 2024 07:26
Writing tech articles

Writing tech articles

This is a description of how I write tech articles for various blogs. Hopefully someone else will find this useful as well.

Create a Gist for the article

When I begin writing a new article, I create a new [GitHub Gist][gist] for the article files. The Gist contains a file for the article text and code examples related to the article.

@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@Tricertops
Tricertops / 1. Text Replacements.md
Last active December 2, 2020 23:56
All the text replacements I use on macOS and iOS.

Text Replacements

iOS: Settings ▸ General ▸ Keyboard ▸ Shortcuts
macOS: System Preferences ▸ Keyboard ▸ Text (drag them to Desktop or drag plist on the table)

Emoji

  • :) 🙂
  • :D 😄 – The most used.
  • ;) 😉
@memfrag
memfrag / HelloWorld.swift
Last active November 12, 2017 02:18
[Swift] Running Swift #! Scripts
#!/usr/bin/xcrun swift
println("Hello, World!")
@manuquentin
manuquentin / gist:6446360
Created September 5, 2013 05:24
Reset git file permissions
git config --global --add alias.permission-reset '!git diff -p -R | grep -E "^(diff|(old|new) mode)" | git apply'
git permission-reset
@aaronpk
aaronpk / gist:5846789
Last active August 23, 2024 23:52
Added WebFinger support to my email address using one rewrite rule and one static file.
[[email protected] www]$ cat .htaccess
RewriteEngine on
RewriteCond %{QUERY_STRING} resource=acct:(.+)
RewriteRule ^\.well-known/webfinger /profile/%1? [L]
[[email protected] www]$ cat profile/[email protected]
{
"subject": "acct:[email protected]",
"links": [
{
@MidnightLightning
MidnightLightning / README.md
Created July 27, 2012 01:50
Steganography tools

Steganography: the art of hiding in plain sight. Messages specifically. These are a series of tools that aid in embedding messages in digital files.

While steganography provides obscurity, it does not strictly provide security. Before hiding your message using any of these scripts, it's suggested you encode your message (try PGP/GnuPG encryption or put it in a TrueCrypt container if you're at a loss).

pngload.py

The PNG file format divides the image data into 'chunks', and allows for additional, private chunks to be added by image editors. This script takes the message you wish to embed and saves it as binary data in such an ancillary chunk.

The files being embedded are compressed with bzip2 compression if they're not already a bzip2 archive. This is different from the `