Skip to content

Instantly share code, notes, and snippets.

View caleywoods's full-sized avatar

Caley Woods caleywoods

View GitHub Profile
@caleywoods
caleywoods / 00_readme.md
Last active January 2, 2024 17:05
Google script to allow voting on a google sheet document.

Vote on Google Sheet

There are some expectations:

  • Score column needs to be configured, column A is 1, column B is 2, etc.
  • Upvote and downvote columns need to be configured in the same way
  • Within your sheet, insert an image into the cells for upvote/downvote. I like to use google image search within the sheets interface to add "up arrow" and "down arrow". You want to use images because you can drag down the corners to autofill the images into new rows as new data is added to the sheet
@caleywoods
caleywoods / encoding_repairer.rb
Created April 20, 2021 20:40 — forked from xijo/encoding_repairer.rb
Repair utf-8 strings that contain iso-8599 encoded utf-8 characters
class EncodingRepairer
REPLACEMENTS = {
"€" => "€", "‚" => "‚", "„" => "„", "…" => "…", "ˆ" => "ˆ",
"‹" => "‹", "‘" => "‘", "’" => "’", "“" => "“", "â€" => "”",
"•" => "•", "–" => "–", "—" => "—", "Ëœ" => "˜", "â„¢" => "™",
"›" => "›", "Å“" => "œ", "Å’" => "Œ", "ž" => "ž", "Ÿ" => "Ÿ",
"Å¡" => "š", "Ž" => "Ž", "¡" => "¡", "¢" => "¢", "£" => "£",
"¤" => "¤", "Â¥" => "¥", "¦" => "¦", "§" => "§", "¨" => "¨",
"©" => "©", "ª" => "ª", "«" => "«", "¬" => "¬", "®" => "®",
local background = display.newImageRect( "background.png", 360, 570 )
local trashcan = display.newImageRect( "trashcan.png", 100, 100 )
local shafi = display.newImageRect( "ShafiChamp.png", 60, 60 )
local physics = require( "physics" )
local timer = require( "timer" )
local spinning = false
local timerID = nil
background.x = display.contentCenterX
background.y = display.contentCenterY
@caleywoods
caleywoods / foo.scss
Created July 4, 2017 17:10
CSS Background image opacity without affecting other elements inside the div (like text), using ::after. If you're not using sass/scss then move the &:after out to its own, #flag-top:after{}
// This is the div you want your background image to be in
#flag-top {
// Here is where the background image is added and the opacity is controlled
&:after {
content : "";
display: block;
position: absolute;
top: 0;
left: 0;
@caleywoods
caleywoods / snippets.cson
Created June 19, 2017 13:53
WPC Atom Snippets
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
'.text.html.vue':
'axios get':
'prefix': 'aget'
'body': """
axios
.get(${1:'/foo/bar'})

Place this in functions.php of your theme or somewhere else it can be called. This adds a link to the WP Admin bar that will deep link you to edit a particular section of the theme customizer in the admin backend.

You can read more about this here

The trick is to link to /customize.php?autofocus[section]={your_section_here}. Some section names in default WP are:

  • title_tagline (For Site Identity)
  • colors (For colors)
  • background_image (For Background Image)
<snippet>
<content><![CDATA[
$wp_customize->add_section( 'lighthouse2.0_contact_info' , array(
'title' => __( 'Contact Info', 'lighthouse2.0' ),
'priority' => 998,
) );
$wp_customize->add_setting( 'lighthouse2.0_contact_info_phone' , array(
'default' => '',
'transport' => 'refresh',

http://imgur.com/a/G2o15

in the first photo I've clicked "Credit Memos" and it makes an ajax call even with the children already shown being present in the second photo. The second photo shows the data that is returned from the loading of the Tree Store that loads the initial set of folders in the first photo.

"TreeNode" in the php code is just a PHP object that mirrors the Ext Tree Node

Array (
[order_id] => 300080
[is_parent_order] => N
[parent_order_id] => 0
[company_id] => 0
[user_id] => 14
[total] => 72.00
[subtotal] => 72
[discount] => 0.00
[subtotal_discount] => 0.00
// BOT WARMUP SCRIPT
sv_cheats 1
// Remove, set 0 or put in // if you don't want replenished ammo or set 2 if you'd rather reload your weapon
sv_infinite_ammo 2
mp_round_restart_delay 0
mp_freezetime 0
mp_spawnprotectiontime 0
mp_startmoney 16000