Skip to content

Instantly share code, notes, and snippets.

@sighingnow
sighingnow / Makefile
Last active April 28, 2024 10:42
Detect operating system in Makefile.
# Detect operating system in Makefile.
# Author: He Tao
# Date: 2015-05-30
OSFLAG :=
ifeq ($(OS),Windows_NT)
OSFLAG += -D WIN32
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
OSFLAG += -D AMD64
endif
@umrashrf
umrashrf / aws_ses.bash
Created July 26, 2016 19:05
Amazon AWS CLI - SES SEND EMAIL
sudo pip install awscli
aws configure
aws ses send-email \
--from "john@gmail.com" \
--destination "ToAddresses=mike@gmail.com" \
--message "Subject={Data=from ses,Charset=utf8},Body={Text={Data=ses says hi,Charset=utf8},Html={Data=,Charset=utf8}}"
@mwufi
mwufi / install_docker_in_colab.sh
Last active April 28, 2024 10:40
Install Docker in Google Colab!
# First let's update all the packages to the latest ones with the following command
sudo apt update -qq
# Now we want to install some prerequisite packages which will let us use HTTPS over apt
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq
# After that we will add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# We will add the Docker repository to our APT sources
@fnky
fnky / ANSI.md
Last active April 28, 2024 10:36
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 10:36
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active April 28, 2024 10:33
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@maxim
maxim / gh-dl-release
Last active April 28, 2024 10:30
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@gadzhimari
gadzhimari / adobe_cc.md
Created November 22, 2018 11:29
Completely Remove Adobe from your Mac in 2 Steps

Step 1

Download and run the Adobe Creative Cloud Cleaner Tool, their multi-app uninstaller and wipe assistant. Adobe does recommend running individual application uninstallers first, your call. Click the Clean All option.

Step 2

Type a one line command in terminal find ~/ -iname "*adobe*" and it's shows up all files which match pattern.

To remove all files

`sudo rm -rf /Applications/Adobe* /Applications/Utilities/Adobe* /Library/Application\ Support/Adobe /Library/Preferences/com.adobe.* /Library/PrivilegedHelperTools/com.adobe.* /private/var/db/receipts/com.adobe.* ~/Library/Application\ Support/Adobe* ~/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.adobe* ~/Library/Application\ Support/CrashReporter/Adobe* ~/Library/Caches/Adobe ~/Library/Caches/com.Adobe.* ~/Library/Caches/com.adobe.* ~/Library/Cookies/com.adobe.* ~/Library/Logs/Adobe* ~/Librar

@chaitanyagupta
chaitanyagupta / _reader-macros.md
Last active April 28, 2024 10:30
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.