Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sisiwei on github.
  • I am sisiwei (https://keybase.io/sisiwei) on keybase.
  • I have a public key ASA4xQKCsfjAtVpmDPJlWeVsZIgoQqH3a8houR3TYUza1Qo

To claim this, I am signing this object:

// This is a javascript bookmarklet that makes Zenefits show you
// your APPROVED vacation taken/scheduled in days instead of hours.
// Notes:
// - Script will probably only work in 2019 'cause it seems complicated to detect year
// - If you don't get 22 days off each year, adjust that number in totalVacation below
// Usage Instructions (2 options, depending on if you've used bookmarklets before):
// 1. Bookmark this:
javascript:(function()%7Bvar%20totalVacation%20%3D%2022%3Bvar%20hoursPerDay%20%3D%208%3Bvar%20approved%20%3D%200%3B%24.each(%24('.z-vr-status-approved%20.u-bold')%2C%20function(k%2Cv)%7B%20approved%20%2B%3D%20Math.abs(v.innerText)%20%7D)%3Bvar%20daysTaken%20%3D%20approved%2FhoursPerDay%3Bvar%20daysRemaining%20%3D%20totalVacation-daysTaken%3B%24('.container.settings').prepend(%22%3Cdiv%20style%3D'margin%3A%2030px%200%200%200%3B'%3EDays%20Taken%3A%20%22%20%2B%20daysTaken%20%2B%20%22%20%2F%2F%20Days%20Remaining%3A%20%22%20%2B%20daysRemaining%20%2B%20%22%3C%2Fdiv%3E%22)%7D)()
<iframe src="https://projects.propublica.org/graphics/d4d-hospital-embed?layout=embed" width="1080px" height="720px" scroll="no" frameBorder="0"></iframe>
<div id="propublica-map"></div>
<script type="text/javascript">
!function(a){"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&module.exports?module.exports=a():window.pym=a.call(this)}(function(){var a="xPYMx",b={},c=function(a){var b=new RegExp("[\\?&]"+a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]")+"=([^&#]*)"),c=b.exec(location.search);return null===c?"":decodeURIComponent(c[1].replace(/\+/g," "))},d=function(a,b){return"*"===b.xdomain||a.origin.match(new RegExp(b.xdomain+"$"))?!0:void 0},e=function(b,c,d){var e=["pym",b,c,d];return e.join(a)},f=function(b){var c=["pym",b,"(\\S+)","(.+)"];return new RegExp("^"+c.join(a)+"$")},g=function(){for(var a=document.querySelectorAll("[data-pym-src]:not([data-pym-auto-initialized])"),c=a.length,d=0;c>d;++d){var e=a[d];e.setAttribute("data-pym-auto-initialized",""),""===e.id&&(e.id="pym-"+d);var f=e.getAttribute("data-pym-src"),g=e.getAttribute("data-pym-xdomain"),h={};g&&(h.xdomain=g),new b.Parent(e.id,f,h)}};return b.Parent=function(a,b,
$('input').click(function(){
// what does $(this) mean?
// what is the html element that we are interacting with, right now?
var inputValue = $(this).val();
var checkedOrNot = $(this).prop('checked');
// Write if/else statement to decide what to do if it's checked, or not checked.
// if it's checked, add it to the textarea
// if it's not checked, replace it with ""
@sisiwei
sisiwei / apdate.js
Last active June 7, 2016 17:44
Converting Dates to AP Style, using Javascript
// Adapated from: https://github.com/banterability/dateline
var APDate = function(dateObj){
this.dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
this.monthNames = ['Jan.', 'Feb.', 'March', 'April', 'May', 'June', 'July', 'Aug.', 'Sept.', 'Oct.', 'Nov.', 'Dec.'];
return this.Deadline(dateObj);
};
APDate.prototype.Deadline = function(dateObj) {
var that = this;
$.each(allSessionNames, function(k,v){
var chartData = [];
$.each(array, function(key,val){
if (v["_source"]["sessionName"] == v["sessionName"]){
chartData.push( parseInt(v["_source"]["duration"]) );
}
})
import requests
import csv
from BeautifulSoup import BeautifulSoup
url = http://www.showmeboone.com/sheriff/JailResidents/JailResidents.asp
# Open the HTML file and turn it into a BeautifulSoup object for parsing
response = requests.get(url)
html = response.content
soup = BeautifulSoup(html)
@sisiwei
sisiwei / youngins.md
Last active August 29, 2015 13:56
NICAR Unsession: "Jobs and Career Straight-Talk: For (and By) Young'uns"

NICAR Unsession: "Jobs and Career Straight-Talk: For (and By) Young'uns"

Recent grads and current students who are attending NICAR next week:

Do you have questions on how to break into the field or get an paid internship/job? Simple or impolitic ones that you couldn't ask a boss or hiring manager/editor? Questions about newsroom "culture" or the tacit knowledge required to network or interview for a job?

Sisi Wei and I, both less than three years out of undergrad, are organizing an unsession ("Jobs and Career Straight-Talk: For (and By) Young'uns Only") to share implicit knowledge and job-seeking advice for students or early-career journalists interested in to becoming designer/developer/data journalists. We're aiming to keep the session informal and totally peer-to-peer, and to make this a safe space to ask silly questions, we're asking mid-career journalists and people with hiring power not to attend.

We'd love for employed less-recent-grads who want to share their wisdom to join us (if you're no