Skip to content

Instantly share code, notes, and snippets.

View nelix's full-sized avatar
🎯
Focusing

Nathan Hutchision nelix

🎯
Focusing
View GitHub Profile
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdarg.h>
#define NOINLINE __attribute__((noinline))
typedef unsigned char byte;
typedef struct Continuation {
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#define NOINLINE __attribute__((noinline))
const size_t CONTINUATION_STACK_SIZE = 8192;
//Derived from http://people.mozilla.org/~dietrich/ubiquity.js
var sources = ["history", "bookmarks", "starred", "tagged", "session"];
var sorts = ["freshness", "age", "frequency", "infrequency", "recency", "staleness"]
var noun_type_places_datasource = new CmdUtils.NounType("datasource", sources);
var noun_type_places_sorts = new CmdUtils.NounType(" sort attribute", sorts);
var debugMode = true;
-Go to the starting point of the project
>> git checkout origin master
-Create and checkout your branch
>> git checkout -b [branch]
-Make changes
>> git commit -a -m"commit messages"
-Push the changes to the remote if you want review, so on
>> git push origin [branch]
-Go back to the branch you want to merge to
>> git checkout master

This is a request for comment - this is a proposed configuration API for the BugHerd Public Feedback and Sidebar

The BugHerd sidebar can be configured to override some of its default behaviour as well as display extra information in any tasks that you pass in from a configuration object called BugHerdConfig.

When setting up BugHerd for the first time, you probably already know you need to add the following code to your site:

  <script type="text/javascript">
    (function (d, t) {
      var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
function each(items,fn){[].forEach.call(items,fn)}
each(document.styleSheets, function(sheet){
if (sheet.cssRules) each(sheet.cssRules, function(r){
try{
// look for the first matching element
if(!document.querySelectorAll(r.selectorText)[0])
console.log("Unused Selector: ", r.selectorText);
} catch (e){
@nelix
nelix / chrome.md
Created July 10, 2014 13:31 — forked from 0xjjpa/chrome.md

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job
var EventSystem = (function() {
var self = this;
self.queue = {};
return {
publish: function (event, data) {
var queue = self.queue[event];
if (typeof queue === 'undefined') {
@nelix
nelix / curry.js
Last active November 13, 2015 16:56 — forked from amatiasq/curry.js
Simple way to recursively curry javascript functions http://jsfiddle.net/amatiasq/osrsomq0/
/**
* @param {Function} fn Function to curry.
* @param {Number} lenght of the arguments required to invoke the function.
* @returns {Function} The currified function.
*/
const curry = (fn, length = fn.length) => function currified(...args) {
if (args.length === 0) {
return currified;
}
@nelix
nelix / helpers.js
Created December 5, 2015 16:37 — forked from br3tt/helpers.js
class Helpers {
currentHP(db) { return db.PlayerInfo.CurrHP }
noCurrentHPGain(db) { return db.PlayerInfo.CurrentHPGain == 0.0 }
radiation(db) { return db.PlayerInfo.TotalDamages[5].Value }
aidItems(db) { return db.Inventory['48'] }
radiationMoreThan(rads) {
return db => {
this.radiation(db) > rads;
};