Skip to content

Instantly share code, notes, and snippets.

@Asparagirl
Asparagirl / gist:6206247
Last active July 19, 2024 15:13
Have a WARC that you would like to upload to the Internet Archive so that it can eventually be included in their Wayback Machine? Here's how to upload it from the command line.

Do you have a WARC file of a website all downloaded and ready to be added to the Internet Archive? Great! You can do that with the Internet Archive's web-based uploader, but it's not ideal and it can't handle really big uploads. Here's how you can upload your WARC files to the IA from the command line, and without worrying about a size restriction.

First, you need to get your Access Key and Secret Key from the Internet Archive for the S3-like API. Here's where you can get that for your IA account: http://archive.org/account/s3.php Don't share those with other people!

Here's their documentation file about how to use it, if you need some extra help: http://archive.org/help/abouts3.txt

Next, you should copy the following files to a text file and edit them as needed:

export IA_S3_ACCESS_KEY="YOUR-ACCESS-KEY-FROM-THE-IA-GOES-HERE"
@nolanlawson
nolanlawson / protips.js
Last active August 22, 2024 14:19
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@nevkontakte
nevkontakte / CLion_Ninja.md
Last active July 10, 2024 09:02
Ninja support for CLion IDE

Ninja support for CLion IDE

This script enables Ninja-powered builds in CLion IDE by wrapping around CMake, which it uses. See my blog post for details.

Disclaimer

This script is provided AS IS with no guarantees given or responsibilities taken by the author. This script relies on undocumented features of CLion IDE and may lead to instability of build and/or IDE. Use it on your own risk under WTFPL terms.

@fiftin
fiftin / Convert PostgreSQL to SQLite
Created October 5, 2015 07:04
Convert PostgreSQL to SQLite
1. Dump the data only sql to file
$ pg_dump --data-only --inserts YOUR_DB_NAME > dump.sql
2. scp to local
3. Remove the SET statements at the top
such as:
SET statement_timeout = 0;
SET client_encoding = 'SQL_ASCII';
4. Remove the setval sequence queries
@rickdog
rickdog / cross-domainYQL.js
Last active September 23, 2020 22:36
x-domain using YQL
// callback is optional, since jQuery has promises
function getFile(theURL, type, callback)
{
/*
* Original jQuery.ajax mid - CROSS DOMAIN AJAX
* @author James Padolsey (http://james.padolsey.com)
* @updated 12-JAN-10
* @info http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/
* source: https://raw.github.com/padolsey/jquery.fn/master/cross-domain-ajax/jquery.xdomainajax.js
*
@matthewjberger
matthewjberger / vs2017.json
Created March 15, 2018 20:44
Beginning of a scoop installer for visual studio 2017 community edition. Uninstall doesn't work
{
"version": "15.6.2",
"url": "https://aka.ms/vs/15/release/vs_community.exe",
"homepage": "https://www.visualstudio.com/",
"checkver": {
"url": "https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes",
"re": "Visual Studio 2017 version (\\d+\\.\\d+\\.\\d+)"
},
"autoupdate": {
"url": "https://aka.ms/vs/15/release/vs_community.exe"
#!/usr/bin/python3
"""
WARNING: The code you are about to view is DISGUSTING
I wrote most of it months ago, so don't ask me what it's doing, or why.
"""
import struct
import sys
@Pinsplash
Pinsplash / bombtype3.cfg
Created September 7, 2024 13:46
Portal 2: Make all gel conversion gel without modifying maps
ent_fire prop_paint_bomb addoutput "painttype 3"