Skip to content

Instantly share code, notes, and snippets.

@AwokeKnowing
AwokeKnowing / PandasTour.ipynb
Last active November 17, 2015 20:35 — forked from wesm/PandasTour.ipynb
Pandas Tour
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AwokeKnowing
AwokeKnowing / aliensay
Last active December 29, 2017 15:23
Say alien things with just [!(+)]
function aliensay(t){
var _={
"a":"(![]+[])[+!+[]]",
"l":"(![]+[])[+!+[]+!+[]]",
"i":"([![]]+[][[]])[+!+[]+[+[]]]",
"e":"(!+[]+[])[+!+[]+!+[]+!+[]]",
"n":"([][[]]+[])[+!+[]]"," ":",",
"u":"([][[]]+[])[+[]]","d":"([][[]]+[])[+!+[]+!+[]]",
"f":"(![]+[])[+[]]","t":"(!+[]+[])[+[]]",
@AwokeKnowing
AwokeKnowing / blti-launch.php
Created June 26, 2018 22:36 — forked from matthanger/blti-launch.php
Sample code for Basic LTI Consumer in PHP
<?php
# ------------------------------
# START CONFIGURATION SECTION
#
$launch_url = "http://www.imsglobal.org/developers/BLTI/tool.php";
$key = "12345";
$secret = "secret";
$launch_data = array(
@AwokeKnowing
AwokeKnowing / mp4_to_gif.sh
Last active August 23, 2018 05:54
Make gif from mp4
ffmpeg -i vid.mp4 -filter_complex "[0:v]setpts=0.25*PTS[v];[v]fps=9,scale=480:-1:flags=lanczos,split [o1] [o2];[o1] palettegen [p]; [o2] fifo [o3];[o3] [p] paletteuse" vid4x.gif
@AwokeKnowing
AwokeKnowing / mysql-docker.sh
Created September 21, 2018 19:48 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@AwokeKnowing
AwokeKnowing / make_docker_ssl_php_apache_server.md
Last active September 21, 2018 21:25
Docker set up a front end website with ssl on blank server (with port 443 open)

Easily set up a front end website with ssl on blank server (with port 443 open)

before you start, you need

  1. install docker

  2. get my.pub.lic.ip (curl https://wtfismyip.com/text)

  3. place the certificate files

/etc/ssl/certs/__mydomain_com.crt
import sys
import re
import uuid
def literal_uuid(m):
return str(uuid.uuid4())
unfixed=""
with open(sys.argv[1],'r') as sqlfile:
unfixed = sqlfile.read()
import sys
import re
import uuid
def literal_uuid(m):
return str(uuid.uuid4())
unfixed=""
with open(sys.argv[1],'r') as sqlfile:
unfixed = sqlfile.read()
@AwokeKnowing
AwokeKnowing / foobar.py
Created October 30, 2020 19:02 — forked from jacquerie/foobar.py
How to decode the message at the end of Google Foobar
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
MESSAGE = '''
EUYQGhMMSx0cU0FIU1MCFAQPG01NQ0gTAEICChUGBxZTRVxBSQoZFQYKHQpKSUNURhcVEgoUFR1I
SltDSBkBTRwKEAgQHxFCSkFJDgkJCgoGCkMLAQBGUklUQhMPAgAJCgYLV0MOSR0VAxAaABZBQVRP
TRICCRVIAk5IEg4dVFRfRkYZBgRARBI=
'''
/* Helper buddy for removing async/await try/catch litter 🗑 */
function O_o(promise) {
return promise.then(data => {
if (data instanceof Error) return [data]
return [null, data]
}).catch(err => [err])
}
/* Look ma, no try/catch */
async function usageExample(params) {