This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pnpm install [email protected] | |
WARN 2 deprecated subdependencies found: @humanwhocodes/[email protected], @humanwhocodes/[email protected] | |
Packages: +22 -30 | |
++++++++++++++++++++++------------------------------ | |
Progress: resolved 774, reused 763, downloaded 3, added 15, done | |
devDependencies: | |
- eslint 8.57.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChangeTextResponseAnswerAnswerTextColumnType < ActiveRecord::Migration | |
def up | |
# set column to not nullable and default to empty string | |
change_column_default :course_assessment_answer_text_responses, :answer_text, '' | |
change_column_null :course_assessment_answer_text_responses, :answer_text, false, '' | |
end | |
def down | |
change_column_default :course_assessment_answer_text_responses, :answer_text, nil | |
change_column_null :course_assessment_answer_text_responses, :answer_text, true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var css = document.createElement("style"); | |
css.type = "text/css"; | |
css.innerHTML = ".trapSelectorBrowserHeading{background:url('" + chrome.extension.getURL("trapSelectorBrowserHeading.jpg") + "') 0 100% no-repeat;position:relative;height:25px;line-height:25px;font-size:10px;padding:0 0 0 8px}.trapSelectorBrowserHeading2{background:url('" + chrome.extension.getURL("trapSelectorBrowserHeadingO.jpg") + "') 0 100% no-repeat;position:relative;height:25px;line-height:25px;font-size:10px;padding:0 0 0 8px}.trapSelectorBrowserHeading3{background:url('" + chrome.extension.getURL("trapSelectorBrowserHeadingF.jpg") + "') 0 100% no-repeat;position:relative;height:25px;line-height:25px;font-size:10px;padding:0 0 0 8px}.trapSelectorBrowserHeading label{color:#fff;font-variant:small-caps;font-weight:bold}.trapSelectorBrowserHeading2 label{color:#fff;font-variant:small-caps;font-weight:bold}.trapSelectorBrowserHeading3 label{color:#fff;font-variant:small-caps;font-weight:bold}" | |
document.body.appendChild(css); | |
var d = new Da |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Question 5 | |
function is_tagged_object(stmt,the_tag) { | |
return is_object(stmt) && | |
stmt.tag === the_tag; | |
} | |
function is_self_evaluating(stmt) { | |
return is_number(stmt) || | |
is_string(stmt) || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
ROUNDS = 1000000 | |
def play(): | |
unopen = [n/2 for n in range(18) ] | |
opened = [] | |
tickets = 0 | |
while len(unopen) > 0 : | |
x = random.randint(0, len(unopen) - 1) | |
if unopen[x] in opened: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(!function($){ | |
var data; | |
if ((typeof user != 'undefined') && user.quests && (data = user.quests.QuestSunkenCity) && data.is_diving) { | |
var output = ''; | |
for (var i = 0; i < data.zones.length; i++) { | |
var zone = data.zones[i]; | |
if (zone.num === data.active_zone) { | |
output += (zone.length + 'm ' + zone.name + ' (' + (zone.width-80+zone.left)/0.6 + 'm left)\n'); | |
} else if (zone.num > data.active_zone) { | |
output += (zone.length + 'm ' + zone.name + '\n'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var $table = $('#connection_data'); | |
var $rows = $('tr', $table).not(':eq(0)'); | |
$('<h4>总连接数:'+ $('li', $rows).length +'</h4>').insertAfter($('h4:contains(总流量)')); | |
}); | |
function sort_by_current_connection() { | |
var $table = $('#connection_data'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$('#sort_connection').click(isort); | |
}); | |
function isort(e) { | |
console.log('sorted'); | |
var $table = $('#connection_data'); // $table = $('table') | |
var $rows = $('tr', $table).not(':eq(0)'); | |
$rows = $rows.sort(isorter); | |
$table.append($rows); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$('#sort_connection').click(isort); | |
}); | |
function isort(e) { | |
console.log('sorted'); | |
var $table = $('#connection_data'); // $table = $('table') | |
var $rows = $('tr', $table).not(':eq(0)'); | |
$rows = $rows.sort(isorter); | |
$table.append($rows); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addOnloadHook(function() { | |
var pLink = document.getElementById('t-permalink') | |
if (pLink) { | |
var permalink = pLink.firstChild.href.replace(/title=[^&]*&/,'') | |
pLink.firstChild.href = permalink; | |
}; | |
var lis = document.getElementsByClassName('mw-headline'); | |
var li, section_name, section_link; |