Skip to content

Instantly share code, notes, and snippets.

View oganm's full-sized avatar
🤦‍♂️

B. Ogan Mancarcı oganm

🤦‍♂️
View GitHub Profile
@foone
foone / censorlist.json
Last active December 3, 2023 12:54
Censor list for the TV Guardian 1.05 version
{
"wordlist": {
"A": {
"trailers": [0],
"flags": ["NEGATIVE MATCH"],
"replacement_offset": 1,
"replacement_word": "TAIL"
},
"A CONDOM": {
"trailers": [0],
@WolfgangSenff
WolfgangSenff / gist:168cb0cbd486c8c9cd507f232165b976
Last active April 15, 2024 22:14
Godot 4.0 Migration/Upgrade guide
## For a beginner-friendly version of the following (more advanced users likely will get better use of the below,
## if you're just starting out...), see this new gist:
## https://gist.github.com/WolfgangSenff/0a9c1d800db42a9a9441b2d0288ed0fd
This document represents the beginning of an upgrade or migration document for GDScript 2.0 and Godot 4.0. I'm focusing on 2D
at the moment as I'm upgrading a 2D game, but will hopefully have more to add for 3D afterward.
## If you want more content like this, please help fund my cat's medical bills at https://ko-fi.com/kyleszklenski - thank you very much! On to the migration guide.
# devtools::install_github("sharlagelfand/ggkeyboard", ref = "main")
library(ggkeyboard)
library(dplyr)
library(ggplot2)
# mac keys
keys <- tkl
keys$r1$key[1:7] <- c("Fn", "Ctrl", "\u2325", "\u2318", "Spacebar", "\u2318", "\u2325")
keys$r1$width[1:7] <- c(rep(1.05, 4), 8.25, rep(1.25, 2))
@bborgesr
bborgesr / shiny-insertUI-removable.R
Last active June 7, 2023 12:07
Uses Shiny's insertUI to create elements (in this example, datatables) at the user's discretion; each of these comes with a button that will remove it from the app (using removeUI).
library(shiny)
ui <- fluidPage(
textInput("divID", "Enter an ID for the custom area:", ""),
helpText("Leave the text input blank for automatically unique IDs."),
actionButton("isrt", "Add a datatable"),
tags$div(id = "placeholder")
)
server <- function(input, output, session) {
rv <- reactiveValues()
@bborgesr
bborgesr / shiny-reactive-R6-object.R
Created August 1, 2017 21:22
Uses the reactiveTrigger() construct in an R6 object class in order to make it useful in reactive settings, like a Shiny app (MWE included)
library(shiny)
reactiveTrigger <- function() {
counter <- reactiveVal( 0)
list(
depend = function() {
counter()
invisible()
},
trigger = function() {

The header format changed quite significantly in 4.8+. Here's what I have so far. Mostly found by comparing headers to the Sync Logs generated by HD Edition, which log game settings & more (SteamApps/common/Age2HD/Logs/%date%/SyncLog GameType etc.txt). Still lots of unknowns :'

struct aoe2recordHeader50 {
  float thousandSomething; // I've seen 1000, 1004, 1005, not sure what for.
  int thousand;
    /* Relevant strings for this space, not sure how they work yet:
      &mrefDlcOptions
      &refGameDataSet
    */
@wch
wch / shim.R
Last active June 2, 2022 10:39
Shim system.file for htmlwidgets so that a dependent package can be used with devtools::load_all()
shim_system_file <- function(package) {
imports <- parent.env(asNamespace(package))
pkgload:::unlock_environment(imports)
imports$system.file <- pkgload:::shim_system.file
}
shim_system_file("htmlwidgets")
shim_system_file("htmltools")
# After the code above has been run, you can load an in-development package
@psychemedia
psychemedia / numbers2words.R
Created July 12, 2015 00:12
R function to convert numbers to words
#https://github.com/ateucher/useful_code/blob/master/R/numbers2words.r
numbers2words <- function(x){
## Function by John Fox found here:
## http://tolstoy.newcastle.edu.au/R/help/05/04/2715.html
## Tweaks by AJH to add commas and "and"
helper <- function(x){
digits <- rev(strsplit(as.character(x), "")[[1]])
nDigits <- length(digits)
if (nDigits == 1) as.vector(ones[digits])
@noamross
noamross / google_wordcloud.R
Created April 22, 2015 01:13
Create a wordcloud of your google search history
# Script to make a word cloud of your google searches. Get your google search
# history at http://history.google.com. This script assumes the JSON files
# exported are in a 'Searches' subfolder
library(jsonlite)
library(rlist)
library(magrittr)
library(stringi)
library(wordcloud)
library(tm)
@facelessuser
facelessuser / ase.py
Last active August 29, 2015 14:16
ase
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import struct
import re
import sys
PY3 = sys.version_info >= (3, 0)
if PY3:
uchr = chr