Skip to content

Instantly share code, notes, and snippets.

View Gozala's full-sized avatar
😱
Oh well

Irakli Gozalishvili Gozala

😱
Oh well
View GitHub Profile
@Gozala
Gozala / AnIntro.md
Created May 30, 2017 16:58 — forked from chrisdone/AnIntro.md
Statically Typed Lisp

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

@Gozala
Gozala / Focus.elm
Last active August 20, 2016 00:18 — forked from debois/Proposal.elm
Declarative focus management API
{-| Focus management is not a trivial task, but luckly most of it's logic can be fully self
contained by principrals of Elm archituture.
-}
import Html exposing (Attribute, Html)
import Html.Attributes exposing (attribute)
import Html.Events
import Setting exposing (setting)
@Gozala
Gozala / git-gpg.md
Created April 12, 2016 21:18 — forked from bcomnes/git-gpg.md
my version of gpg on the mac
  1. brew install gnupg21, pinentry-mac (this includes gpg-agent and pinentry)
  2. Generate a key: $ gpg --gen-key
  3. Take the defaults. Whatevs
  4. Tell gpg-agent to use pinentry-mac:
$ vim ~/.gnupg/gpg-agent.conf 
@Gozala
Gozala / gist:5584873
Last active December 17, 2015 09:08 — forked from ZER0/gist:5548355
// Button is a high level construct that can be used
// to define button types with a specific behaviors
let { Button } = require("sdk/ui");
// Button with specicic behavior can be defined by passing a function
// defining a behaivor of a button on the specific state changes.
var button = Button(function behavior(state, {owner}) {
// First argument represents current `state` snapshot for the button
// in the context of the given `options.owner` window.
@Gozala
Gozala / API-Overview.md
Last active December 16, 2015 06:29 — forked from ZER0/gist:5209412
Direct page to add-on communication

Consider following example where:

A - addon

B - evil.com

  • C - good.com

Related material

@Gozala
Gozala / tweets.js
Last active December 15, 2015 16:59 — forked from jcoglan/tweets.js
// This is in response to https://gist.github.com/Peeja/5284697.
// Peeja wanted to know how to convert some callback-based code to functional
// style using promises.
var Promise = require('rsvp').Promise;
var ids = [1,2,3,4,5,6];
// If this were synchronous, we'd simply write:
@Gozala
Gozala / gist:4637925
Last active December 11, 2015 17:58 — forked from fitzgen/gist:4637923
var obj = {
_discoverScriptsAndSources: function TA__discoverScriptsAndSources() {
let scriptsAdded = [];
for (let s of this.dbg.findScripts()) {
if (!this._allowSource(s.url)) {
continue;
}
scriptsAdded.push(this._addScript(s));
@Gozala
Gozala / iframe.js
Created December 11, 2012 21:55 — forked from anonymous/iframe.js
Updated version
let { Cc, Ci } = require('chrome');
let appShellService = Cc['@mozilla.org/appshell/appShellService;1'].
getService(Ci.nsIAppShellService);
let service = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
let window = appShellService.hiddenDOMWindow;
let document = window.document;
let XUL = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'
@Gozala
Gozala / case.js
Created November 6, 2012 00:23 — forked from isaacs/case.js
npm testcase
var npm = require("npm")
var path = require("path")
npm.load({ prefix: path.join(process.env.HOME, ".orchestrator") }, function(e, npm) {
npm.commands.ls([], function(err, _) {
// this time it's nothing but probably results are cached
npm.commands.install(["method"], function(err, _) {
// now there is something but it still thinks there is nothing.
npm.commands.ls([], console.log)
})
@Gozala
Gozala / derp-modules.js
Created October 11, 2012 08:56 — forked from gordonbrander/derp-modules.js
Simple, tiny, dumb JavaScript Modules
(function(exports) {
// Simple, tiny, dumb module definitions for Browser JavaScript.
//
// What it does:
//
// * Tiny enough to include anywhere. Intended as a shim for delivering
// browser builds of your library to folks who don't want to use script loaders.
// * Exports modules to `__modules__`, a namespace on the global object.
// This is an improvement over typical browser code, which pollutes the
// global object.