Skip to content

Instantly share code, notes, and snippets.

Alexandre Kirszenberg alexkirsz

View GitHub Profile
@alexkirsz
alexkirsz / tamper.js
Created Feb 9, 2018
Tamper with Facebook's draft editor
View tamper.js
// ==UserScript==
// @name Facebook Tamper
// @version 0.1
// @author Alexandre Kirszenberg
// @match https://www.facebook.com/*
// @grant none
// ==/UserScript==
(function() {
function compose(React, ContentState, EditorState, DraftEditor) {
@alexkirsz
alexkirsz / user-script.js
Created Oct 2, 2016
Decent OfficeMix player
View user-script.js
// ==UserScript==
// @name Decent OfficeMix player
// @version 1.0
// @description Remove paused logo and add keyboard controls to the OfficeMix player
// @author Alexandre Kirszenberg <alexandre.kirszenberg@gmail.com>
// @run-at document-start
// @match https://mix.office.com/embed/*
// @grant none
// ==/UserScript==
@alexkirsz
alexkirsz / facebook-flowers.js
Created Jun 2, 2016
Always add flowers to Facebook Messenger
View facebook-flowers.js
import React, { Component } from 'react';
function compose(ChatMessage, ImmutableObject) {
return class ComposedChatMessage extends Component {
render() {
const message = new ImmutableObject(this.props.message, {
customizations: [
{
customization_type: 'border',
customization_value: 'flowers',
@alexkirsz
alexkirsz / sixth-sense.js
Created May 23, 2016
Core hook of the Facebook Sixth Sense Chrome extension
View sixth-sense.js
function getUserId(fbid) {
return fbid.split(':')[1];
}
requireLazy(
['MercuryTypingReceiver', 'MercuryThreads', 'ShortProfiles'],
(MercuryTypingReceiver, MercuryThreads, ShortProfiles) => {
MercuryTypingReceiver
.get()
@alexkirsz
alexkirsz / script.js
Last active Jan 17, 2016
YouTube Player for edX
View script.js
// ==UserScript==
// @name YouTube Player for edX
// @namespace morhaus
// @version 1.1
// @description Replace the default edX video player with the YouTube player
// @author Alexandre Kirszenberg <alexandre.kirszenberg@gmailcomr>
// @match https://courses.edx.org/*
// @match https://courses.ionisx.com/*
// @grant none
// ==/UserScript==
View OCaml-REPL-windows.sublime-build
{
"shell_cmd": "type $file | ocaml",
"selector": "source.ml"
}
@alexkirsz
alexkirsz / gist:ec9f5d4479efc115e533
Last active Aug 29, 2015
Children propType validation
View gist:ec9f5d4479efc115e533
let propTypes = {
children(props, propName) {
let errors = [];
React.Children.map(props[propName], child => {
if (child.type !== Foo) {
errors.push(`${child.key} is not a Foo element`);
}
});
if (errors.length > 0) {
return new Error(errors.join(', '));
@alexkirsz
alexkirsz / gist:78fe94eb84451a55ba9e
Last active Aug 29, 2015
Date to/from date and time inputs
View gist:78fe94eb84451a55ba9e
let [date, time] = dateObj.toISOString().split('T');
time = time.split('.')[0].split(':').slice(0, 2).join(':');
let dateObj = new Date(`${date}T${time}.000Z`);
@alexkirsz
alexkirsz / ForceCaseSensitivityPlugin.js
Last active Feb 23, 2017
Force case sensitivity in webpack
View ForceCaseSensitivityPlugin.js
/*
The MIT License (MIT)
Copyright (c) 2015 Alexandre Kirszenberg
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTI
View gist:3a5df8f9fa8b5ac20178
function TorrentStore() {
EventEmitter.call(this);
}
TorrentStore.prototype = Object.assign({}, EventEmitter.prototype, { ... });
You can’t perform that action at this time.