Skip to content

Instantly share code, notes, and snippets.

@stevenqzhang
stevenqzhang / ChromeExtensionGulp.js
Created March 6, 2017 00:09 — forked from lykmapipo/ChromeExtensionGulp.js
Gulp file for building a Chrome Extension
'use strict';
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev
var gulp = require('gulp'),
clean = require('gulp-clean'),
cleanhtml = require('gulp-cleanhtml'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stripdebug = require('gulp-strip-debug'),
@stevenqzhang
stevenqzhang / jasmine_chrome_tests.md
Last active June 26, 2017 18:37 — forked from ecmendenhall/jasmine_chrome_tests.md
Integrating the Jasmine test runner for Chrome extension development

[Jasmine][jas] is an excellent framework for JavaScript testing, but I had a tough time coaxing it into cooperation with the Chrome extension I was developing. Jasmine's default testrunner uses an inline script block that listens for window.onload to setup the test environment, but Chrome prohibits extensions from running inline code. Alas, it's not as easy as importing the inline code as a separate file. After a little tinkering, this is what I came up with:

Extension
    ├── html
    ├── js 
    ├── manifest.json
    └── tests
        ├── jasmine
        │   └── lib

│   └── jasmine-2.5.2

@stevenqzhang
stevenqzhang / custom_facebook.css
Last active October 3, 2018 19:16
facebook css customizations
/* Copy paste from https://gist.github.com/stevenqzhang/35c26c2862d8ccc7373f1e1ae5eb34318*/
/*use https://chrome.google.com/webstore/detail/user-css/okpjlejfhacmgjkmknjhadmkdbcldfcb?hl=en* to map this to facebook.com/
/*Hide message and notification count -> force me to go to messenger.com and facebook.com/notifications on regular basis instead*/
.jewelCount {
display: none;
}
/* Hide like notifications: https://github.com/zerobase/fb_hide_like_notifs/blob/master/content_script.css*/
._33c[data-gt*='"notif_type":"like"'],
._33c[data-gt*='"notif_type":"like_tagged"'],
@stevenqzhang
stevenqzhang / getpaco_qs.sh
Created October 1, 2015 01:43
script for getting paco data automatically
#/bin/bash
# be sure to generate a stored refresh token by running set_oauth.sh first (should only need it once unless you revoke the token)
# Read the stored refresh token. Get a new access token with it. Then, finally, doing something with a Paco endpoint.
refresh_token=`cat ~/.qs_paco`
# it's late and I can't seem to reliably cut out wrapping quotes from set_outh. Make sure they are gone here on reload. TODO fix the storage to begin with.
export refresh_token=`sed -e 's/^"//' -e 's/"$//' <<< $refresh_token`
# get a new access token from the refresh token
# http://superuser.com/questions/742115/powershell-equivalent-of-grep-r-l-files-with-matches
Get-ChildItem -Recurse *.* | Select-String -Pattern "foo" | Select-Object -Unique Path
#one liner for getting my favorite bashrc settings
# look for ~szhang, otherwise don't
# TODO put history files in the same directory...
# Using wget
mkdir -p ~/dev/{dotfiles} && wget https://raw.githubusercontent.com/stevenqzhang/dotfiles/master/.bashrc -P ~/dev/dotfiles/ && echo source ~/dev/dotfiles/.bashrc >> ~/.bashrc && source ~/.bashrc
#using git clone
git clone https://github.com/stevenqzhang/dotfiles.git ~/dev/dotfiles && echo source ~/dev/dotfiles/.bashrc >> ~/.bashrc && source ~/.bashrc