Skip to content

Instantly share code, notes, and snippets.

@alexstrat
alexstrat / example1.js
Last active September 27, 2017 15:29
Prez
const bw = new BrowserWindow();
bw.loadURL('https://thirdparty.com');
// thirdparty.com was attacked and malicious script injected:
const fs = require('fs');
const file = fs.readFileSync('/secret/file/content.text');
// boom
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
appId: org.efounders.BrowserXCanary
productName: 'Station Canary'
mac:
category: public.app-category.tools
icon: 'build/icon-canary.icns'
win:
icon: 'build/icon-canary.ico'
# will override properties in package.json
extraMetadata:
diff --git a/app/applications/duck.js b/app/applications/duck.js
index 87651b4..0c61ede 100644
--- a/app/applications/duck.js
+++ b/app/applications/duck.js
@@ -79,6 +79,10 @@ export default function applications(state = new Map(), action) {
return state.setIn([applicationId, 'iconURL'], imageURL);
}
+ case 'ADD_FUCKED_UP_APPLICATION': {
+ return state.set(null, new Map({ activeTab: 'ta maman' }));
@alexstrat
alexstrat / blockers.md
Last active April 2, 2020 10:53
Chrome extensions support in Electron

Here is a list of blockers I stumbled upon while trying to run some Chrome extensions in Electron.

Description Reference on electron repo Extensions blocked
Add API to load extensions independent of devToolsExtensions pull#9918 all
content_scrips support: support CSS in pull#10076* Mailtracker Grammarly
content_scrips support: fix matches rules implementation
@alexstrat
alexstrat / TokenManager.js
Created April 18, 2017 10:21
Auth0: a way to renew a token for Management API in a long-running script
const jsonwebtoken = require('jsonwebtoken')
const request = require('superagent')
const Promise = require('bluebird')
class Auth0TokenManager {
constructor (options) {
this.domain = options.domain
this.clientId = options.clientId
this.clientSecret = options.clientSecret
@alexstrat
alexstrat / generate_credits.js
Last active September 8, 2016 14:46
thenounproject credits generation from the activity page
$activities = $('#activity-list').children()
// add a checkbox to each icon
$activities.each(function(_, el){
var a = $(el).find('.notification-action a')[0]
$('<input type="checkbox" class="action">').insertAfter(a)
})
// expose a function that generates
// credits for checked icons only
@alexstrat
alexstrat / ads_report.csv
Last active February 24, 2016 16:17
Work4 analyst test datasets
date campaign_name ad_name targeting_type bid_type impressions reach clicks applicants amount_spend_dollars
2/1/2016 Campaign 1 Interests - CPC [job_id=63100481] Interests CPC 1722 1333 14 1 8.44
2/1/2016 Campaign 1 Interests - oCPM [job_id=63100481] Interests oCPM 1693 1584 7 1 6.45
2/1/2016 Campaign 1 Work Position - CPC [job_id=67563580] Work Position CPC 1542 1414 16 1 9.66
2/1/2016 Campaign 1 Interests - oCPM [job_id=67563580] Interests oCPM 1607 1517 13 1 10.37
2/1/2016 Campaign 1 Interests - CPC [job_id=68755574] Interests CPC 1982 1964 18 0 10.69
2/1/2016 Campaign 1 Interests - oCPM [job_id=68755574] Interests oCPM 1917 1650 10 1 9.17
2/1/2016 Campaign 1 Work Position - oCPM [job_id=68755574] Work Position oCPM 1959 1651 12 1 8.48
2/1/2016 Campaign 1 Interests - CPC [job_id=74131568] Interests CPC 1702 1568 7 1 5.57
2/1/2016 Campaign 1 Interests - oCPM [job_id=74131568] Interests oCPM 1672 1431 8 0 6.65
<?xml version="1.0" encoding="UTF-8" ?>
<jobs>
<job>
<contract>Full Time</contract>
<location>Red Bank, NJ, US</location>
<title>UX/UI Developer</title>
<label>·</label>
</job>
<job>
<contract>Full Time</contract>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.