Skip to content

Instantly share code, notes, and snippets.

View sunny-g's full-sized avatar

Sunny Gonnabathula sunny-g

View GitHub Profile
@rolaveric
rolaveric / gopherjsIntroMain.go
Last active September 28, 2017 15:39
A simple example of a Go library, and how to expose it to the global scope when run through GopherJS.
package main
import (
"github.com/gopherjs/gopherjs/js"
"github.com/rolaveric/pet"
)
func main() {
js.Global.Set("pet", map[string]interface{}{
"New": pet.New,
@Jim-Salmons
Jim-Salmons / gist:8640853
Last active July 9, 2019 12:50
The Absolute Basics of a Self-Descriptive Neo4j Graph Database

The "Self-Descriptive" Neo4j Graph Database

#SmartData Metamodel Subgraph Design in the FactMiners' Social-Game Ecosystem - Part 1 of 2

Author: Jim Salmons, Co-founder & Research/Tech Lead - FactMiners.org and The Softalk Apple Project

@jexp
jexp / cypher.js
Created January 19, 2014 15:44
Javascript Snippet to simply access transactional Cypher Http endpoint of the Neo4j Server (see http://docs.neo4j.org/chunked/milestone/rest-api-transactional.html)
var r=require("request")
function cypher(query,params,cb) {
r.post({uri:"http://localhost:7474/db/data/transaction/commit",
json:{statements:[{statement:query,parameters:params}]}},
function(err,res) { cb(err,res.body)})
}
var query="MATCH (n:User) RETURN n, labels(n) as l LIMIT {limit}"
var params={limit: 10}
var cb=function(err,data) { console.log(JSON.stringify(data)) }
@karlgluck
karlgluck / Hash Ladders for Shorter Lamport Signatures.md
Last active May 10, 2025 01:59
I describe a method for making Lamport signatures take up less space. I haven't seen anyone use hash chains this way before, so I think it's pretty cool.

What's this all about?

Digital cryptography! This is a subject I've been interested in since taking a class with Prof. Fred Schneider back in college. Articles pop up on Hacker News fairly often that pique my interest and this technique is the result of one of them.

Specifically, this is about Lamport signatures. There are many signature algorithms (ECDSA and RSA are the most commonly used) but Lamport signatures are unique because they are formed using a hash function. Many cryptographers believe that this makes them resistant to attacks made possible by quantum computers.

How does a Lamport Signature work?

@mprymek
mprymek / gist:8379066
Last active July 22, 2022 09:18
Elixir metaprogramming example
# This is an example of metaprogramming in the Elixir language.
#
# We will define a domain specific language (DSL) for the definition
# of a service which is watched by several sensors.
# Each sensor watches some property/functionality of the service and
# returns the result of the check.
#
# To determine if the service is functioning properly, we need functions
# to run all the sensors' code and gather the returned data.
#
@XVilka
XVilka / TrueColour.md
Last active November 27, 2025 14:11
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@oubiwann
oubiwann / joes-fav.lfe
Last active July 22, 2019 21:59
Joe Armstrong's Favorite Erlang Program... in LFE
(defmodule joes-fav
(export all))
(defun universal-server ()
(receive
((tuple 'become server-function)
(funcall server-function))))
(defun factorial
((0) 1)
anonymous
anonymous / Makefile
Created December 15, 2013 11:58
Hedging client for Ripple
HEDGE = node riphedge
all:
npm install ripple-lib
hedge:
-while date; do \
$(HEDGE); \
sleep 100; \
done
@petehunt
petehunt / React sortable
Created December 9, 2013 22:30
Here's an example of React + jQuery UI sortable. The key thing to note is that we have the render() method do absolutely nothing and use componentDidUpdate() + React.renderComponent() to proxy updates through to the children. This lets us manage the DOM manually but still be able to use all the React goodies you know and love.
<html>
<head>
<title>Test</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://fb.me/react-0.5.1.js"></script>
<script src="http://fb.me/JSXTransformer-0.5.1.js"></script>
</head>
@travismillerweb
travismillerweb / scroll-shadow.css
Created September 23, 2013 18:57
CSS - Google Scroll Shadow
/*
Gmail/Google Reader Sidebar Scroll Shadows
-------------------------------------------
Neat effect that mimics the scroll shadows that appear in the GOogle sitde bar and visually cues users to scroll up or down depending on their position.
Credit goes to Lea Verou for this awesome find.
Source:
Lea's Talk: http://www.youtube.com/watch?v=3ikye7Qc7Ak
Code Source: http://lea.verou.me/more-css-secrets/#slide9