Skip to content

Instantly share code, notes, and snippets.

View rsrini7's full-sized avatar
😃
Happy

Srinivasan Ragothaman rsrini7

😃
Happy
View GitHub Profile
@eyston
eyston / gist:1061591
Created July 2, 2011 20:01
Example of Akka Actor Become
import akka.actor.Actor
// defining messages -- Object = singleton, case class = DTO (sorta, generally)
object Born
case class Evolve(numberOfNeighbors: Int)
object Status
// receive is the method that handles incoming messages.
// alive: Receive and dead: Receive are defining alternative ways to respond to messages
// these will be switched on during runtime
@mhawksey
mhawksey / gist:1170597
Created August 25, 2011 13:02
Google Apps Script to fill in a Document template with Spreadsheet data
function onOpen() {
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}];
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Fitness Diaries", menuEntries);
}
function createDocFromSheet(){
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries
// get the data from an individual user
diff --git a/ext/bluecloth.h b/ext/bluecloth.h
index 230618b..97053b5 100644
--- a/ext/bluecloth.h
+++ b/ext/bluecloth.h
@@ -7,20 +7,21 @@
#ifndef BLUECLOTH_H
#define BLUECLOTH_H
+#include "ruby.h"
+
@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created March 6, 2012 01:05
How to fork a github repository in bitbucket

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync
@ymnk
ymnk / AES.java
Last active July 20, 2023 15:54
JSch examples
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/**
* This program will demonstrate how to use "aes128-cbc".
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
public class AES{
@endolith
endolith / LICENSE.txt
Last active January 14, 2024 07:37
Arduino hardware true random number generator
MIT License
Copyright (c) 2012 endolith
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:
@stuarthalloway
stuarthalloway / Datomic News Updates
Created June 18, 2012 14:53
Datomic update examples against a social news database
;; Datomic example code
;; demonstrates various update scenarios, using a news database
;; that contains stories, users, and upvotes
;; grab an in memory database
(use '[datomic.api :only (q db) :as d])
(def uri "datomic:mem://foo")
(d/create-database uri)
(def conn (d/connect uri))
@egaumer
egaumer / DSL Examples
Last active June 26, 2019 20:21
Some example queries using elastic.js
# simple match all query with term facet
ejs.Request()
.indices("myindex")
.types("mytype")
.query(ejs.MatchAllQuery())
.facet(
ejs.TermsFacet('url')
.field('url')
.size(20))
@zach-klippenstein
zach-klippenstein / ChangePassword.java
Last active April 3, 2024 18:04
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall (rsdio@metastatic.org), and the original source is available at http://metastatic.org/source/JKS.java. I've in…
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{