Skip to content

Instantly share code, notes, and snippets.

@calebgrove
calebgrove / stateToAbbr.js
Last active April 24, 2024 22:18
Convert state name to abbreviation in JavaScript. There's some better solutions in the comments, so scroll down!
// There's some better solutions in the comments, so scroll down and see how other folks have improved this!
// USAGE:
// abbrState('ny', 'name');
// --> 'New York'
// abbrState('New York', 'abbr');
// --> 'NY'
function abbrState(input, to){
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 24, 2024 22:18
Complete Recent Discord Quest

Complete Recent Discord Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
@roib20
roib20 / apt-repo-playbook.yaml
Last active April 24, 2024 22:17
Example usages of the new `deb822_repository` Ansible module
---
- hosts: localhost
connection: local
gather_facts: true
tasks:
- name: Add APT repositories
when: ansible_os_family == 'Debian'
become: true
block:
@jkmartindale
jkmartindale / awa-twitch.js
Last active April 24, 2024 22:13
Paste this into your browser console to hopefully start earning rewards. Forum thread: https://web.archive.org/web/20230922092451/https%3A%2F%2Fna.alienwarearena.com%2Fucf%2Fshow%2F2167631
/* Twitch Quest Fixer v3.1 */
const extensionID = "ehc5ey5g9hoehi8ys54lr6eknomqgr";
const channel = location.pathname.slice(1).toLowerCase();
const channelId = __APOLLO_CLIENT__.cache.data.data.ROOT_QUERY["channel({\"name\":\""+channel+"\"})"].__ref.split(":")[1];
const pollDuration = 60000;
let authToken = __APOLLO_CLIENT__.cache.data.data["Channel:" + channelId].selfInstalledExtensions.filter(x => x.helixToken.extensionID == extensionID)[0].token.jwt;
grantPermission = async () => {
console.log("Attempting to grant permission automatically...");
const integrityResponse = await (await fetch("https://gql.twitch.tv/integrity", { method: "post", headers: commonOptions.headers })).json();
@loujaybee
loujaybee / createApacheUserData.sh
Created April 20, 2020 07:06
Basic Apache Web Server For Use In AWS User Data Script
#!/bin/bash
sudo su
yum -y install httpd
echo "<p> My Instance! </p>" >> /var/www/html/index.html
sudo systemctl enable httpd
sudo systemctl start httpd
# -*- encoding: utf-8 -*-
#
# Copyright © 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@AbstractUmbra
AbstractUmbra / 00-deprecation.md
Last active April 24, 2024 22:07
discord.py 2.0+ slash command info and examples

This gist has now been 'deprecated' and has moved...

... to my blog style space for easier contribution by third parties and to provide what I believe to be an easier reading experience. Please field all enquiries and issues to the source repository.

@Maximilian-Winter
Maximilian-Winter / gbnf_grammar_generator.py
Last active April 24, 2024 22:03
GBNF grammar generator for always valid function calls and object creation in JSON with llama.cpp
import inspect
import json
import re
import typing
from inspect import isclass, getdoc
from types import NoneType
from pydantic import BaseModel, Field
from pydantic.fields import FieldInfo
from typing import Any, Type, List, get_args, get_origin, Tuple, Union, Optional
@banaslee
banaslee / XGH - en.txt
Last active April 24, 2024 22:00
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Source: http://gohorseprocess.wordpress.com
1. I think therefore it's not XGH.
In XGH you don't think, you do the first thing that comes to your mind. There's not a second option as the first one is faster.
2. There are 3 ways of solving a problem: the right way, the wrong way and the XGH way which is exactly like the wrong one but faster.
XGH is faster than any development process you know (see Axiom 14).
@xl7dev
xl7dev / VMwareFusion_Export_ovf.txt
Last active April 24, 2024 21:52
HowTo Export a VM in OVA format in VMware Fusion for OS X
> cd /Applications/VMware Fusion.app/Contents/Library/VMware OVF Tool
> ./ovftool --acceptAllEulas /Users/marco/Documents/Virtual\ Machines.localized/Windows\ 8.1\ x64.vmwarevm/Windows\ 8.1\ x64.vmx /Users/marco/Desktop/Win81.ova