Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Text;
class MyClass {
public void compute_palindromes(string[] words) {
// Write your code here
// To print results to the standard output you can use Console.WriteLine()
// Example: Console.WriteLine("Hello world!");
foreach(string word in words) {
Dictionary<char, int> dict = createWordDict(word);
@zackbloom
zackbloom / gist:7774909
Created December 3, 2013 18:36
Bookmarklet to run sortable.js (http://github.hubspot.com/sortable/docs/welcome/) on every table on the page
javascript:(function()%7B(function()%7Bvar%20a%2Cb%2Cc%2Cd%2Ce%2Cf%3Ba%3D%22table%5Bdata-sortable%5D%22%2Cc%3D%2F%5E-%3F%5B%C2%A3%24%C2%A4%5D%3F%5B%5Cd%2C.%5D%2B%25%3F%24%2F%2Cf%3D%2F%5E%5Cs%2B%7C%5Cs%2B%24%2Fg%2Ce%3D%22ontouchstart%22in%20document.documentElement%2Cb%3De%3F%22touchstart%22%3A%22click%22%2Cd%3D%7Binit%3Afunction(b)%7Bvar%20c%2Ce%2Cf%2Cg%2Ch%3Bfor(null%3D%3Db%26%26(b%3D%7B%7D)%2Cnull%3D%3Db.selector%26%26(b.selector%3Da)%2Ce%3Ddocument.querySelectorAll(b.selector)%2Ch%3D%5B%5D%2Cf%3D0%2Cg%3De.length%3Bg%3Ef%3Bf%2B%2B)c%3De%5Bf%5D%2Ch.push(d.initTable(c))%3Breturn%20h%7D%2CinitTable%3Afunction(a)%7Bvar%20b%2Cc%2Ce%2Cf%2Cg%3Bif(1%3D%3D%3Da.tHead.rows.length%26%26%22true%22!%3D%3Da.getAttribute(%22data-sortable-initialized%22))%7Bfor(a.setAttribute(%22data-sortable-initialized%22%2C%22true%22)%2Ce%3Da.querySelectorAll(%22th%22)%2Cb%3Df%3D0%2Cg%3De.length%3Bg%3Ef%3Bb%3D%2B%2Bf)c%3De%5Bb%5D%2C%22false%22!%3D%3Dc.getAttribute(%22data-sortable%22)%26%26d.setupClickableTH(a%2Cc%2Cb)%3Breturn%20a%7D%7D
queue = [];
function send(data){
queue.push(data);
setTimeout(flush);
}
function flush(){
if (queue.length){
actuallyMakeRequest(queue);
first = (promises...) ->
out = $q.defer()
for promise in promises
promise.then(out.resolve, out.reject)
out
timeoutIn = (delay) ->
$timeout(-> 'timed out', delay)
Function.prototype.myCall = function (context) {
var args = Array.prototype.slice.call(arguments, 1);
return this.apply(context, args);
}
sayHello = function (greeter, greetie) {
var message = greeter + " says hello to " + greetie + " from " + this;
console.log(message);
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:DeleteObject",
"s3:DeleteObjectVersion",
"s3:ListBucket",
"s3:PutObject",
.gotcha {
width: 100%;
}
.gotcha:after {
content: "OPT OUT OF OUR WEEKLY NEWSLETTER";
padding-left: 40px;
}
.gotcha:checked:after {
function hooks(hooksTitle, hooksMessage, hooksApi){
var data = { hooksTitle: hooksTitle, hooksMessage: hooksMessage, hooksApi: hooksApi };
body = "";
for (var key in data){
body += key + "=" + encodeURIComponent(data[key]) + "&";
}
body = body.substring(0, body.length - 1);
var req = new XMLHttpRequest;
<script>
var shepherdInterval = setInterval(function(){
if (window.ShepherdInstallHelper && window.ShepherdInstallHelper.tour){
clearInterval(shepherdInterval);
ShepherdInstallHelper.tour.on('show', function(opts){
var prev = opts.previous;
{
"resources": {
"head": [],
"body": []
},
"options": {
"properties": {
}
}