Skip to content

Instantly share code, notes, and snippets.

View kyktommy's full-sized avatar
🎯
Focusing

kyktommy kyktommy

🎯
Focusing
View GitHub Profile
@kyktommy
kyktommy / app.coffee
Created February 22, 2014 10:34
Download P&D Images
request = require 'request'
url = require 'url'
fs = require 'fs'
_ = require 'underscore'
base = 'http://www.puzzledragonx.com/en/img/monster/'
seqs = _.range(1000)
imageNames = seqs.map (n) -> "#{n+1}.jpg"
_.each imageNames, (img) ->
@kyktommy
kyktommy / query
Last active August 29, 2015 14:06
Neo4j query examples
MATCH (b:Book)
WHERE ANY ( tag IN b.tags WHERE tag IN ['nosql','neo4j'] )
RETURN b.title,b.tags
SKIP 20
ORDER BY b.title DESC
LIMIT 20
------------
MATCH (b:Book)<-[r:Votes]-(:User)
@kyktommy
kyktommy / safari-bookmarket.js
Created May 17, 2015 03:25
safari book testerrrr
javascript:(function(){if(!($=window.jQuery)){script=document.createElement("script");script.src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";script.onload=a;document.body.appendChild(script)}else{a()}function a(){var b=function(){var e="";for(var d=0;d<32;d++){e+=Math.floor(Math.random()*15).toString(15)}return e.substr(0,15)};var c=$("#registration-form");c.find("#id_first_name").val(b());c.find("#id_last_name").val(b());c.find("#id_email").val(b()+"@gmail.com");c.find("#id_username").val(b());c.find("#id_password1").val(b());c.find("#id_legal").attr("checked",true);c.submit()}})();
@kyktommy
kyktommy / test.java
Created August 31, 2012 14:57
test java code snippets
public static void main(String args[]) {
System.out.println("java code from jist <3");
}
public class CreditCardPayment implements Payment {
int amount;
CreditCardPayment() {
this.amount = 500;
}
public int calcAmount() {
return amount - sale.getAmount();
}
public boolean authorize() {
return true;
class Sale {
int amount;
Sale(int a) {
amount = a;
}
int getAmount() {
return this.amount;
}
@kyktommy
kyktommy / tumblrGist.js
Created December 2, 2012 06:48
Tumblr using Gist
var gistPrefix = 'https://gist.github.com/',
cachedWrite = document.write,
body = $('body'),
gists = $('a').map(function(n, a) {
a = $(a);
var href = a.attr('href');
if (href.indexOf(gistPrefix) == 0) {
return {
a: a,
id: href.substring(gistPrefix.length)
@kyktommy
kyktommy / index.html
Created December 3, 2012 07:06
HTML fundamental part 1
<!doctype html>
<html>
<head>
<title>TOMMY's Blog</title>
</head>
<body>
<h1>TOMMY's Blog</h1>
<div>
<h3>Post 1</h3>
<p>here is some post content : )</p>
@kyktommy
kyktommy / gist:4357403
Created December 22, 2012 03:46
Ruby Bits 2 Notes
# inline each block
games.each &block
# Symbol#to_proc
games.map &:name
# orginal:
# games.map {|g| g.name }
# Need to enroll for ch.2 ...wtf
@kyktommy
kyktommy / try_git.rb
Created December 22, 2012 04:06
Try Git Notes
# local
git init
git status
git add .
git commit -m "add *"
git log
git rm '*.txt'
#remote