This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String args[]) { | |
System.out.println("java code from jist <3"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sale { | |
int amount; | |
Sale(int a) { | |
amount = a; | |
} | |
int getAmount() { | |
return this.amount; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CreditCardPayment implements Payment { | |
int amount; | |
CreditCardPayment() { | |
this.amount = 500; | |
} | |
public int calcAmount() { | |
return amount - sale.getAmount(); | |
} | |
public boolean authorize() { | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# local | |
git init | |
git status | |
git add . | |
git commit -m "add *" | |
git log | |
git rm '*.txt' | |
#remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:document.write(%27%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3Cmeta%20charset%3D%22utf-8%22%3E%3Ctitle%3EResponsive%20Design%20Testing%3C/title%3E%3Cstyle%3Ebody%20%7B%20margin:%2020px%3B%20font-family:%20sans-serif%3B%20overflow-x:%20scroll%3B%20%7D.wrapper%20%7B%20width:%206000px%3B%20%7D.frame%20%7B%20float:%20left%3B%20%7Dh2%20%7B%20margin:%200%200%205px%200%3B%20%7Diframe%20%7B%20margin:%200%2020px%2020px%200%3B%20border:%201px%20solid%20%23666%3B%20%7D%3C/style%3E%3C/head%3E%3Cbody%3E%3Cdiv%20class%3D%22wrapper%22%3E%3Cdiv%20class%3D%22frame%22%3E%3Ch2%3E240%3Cspan%3E%20x%20320%3C/span%3E%20%3Csmall%3E(mobile)%3C/small%3E%3C/h2%3E%3Ciframe%20src%3D%22%27%20%2B%20window.location%20%2B%20%27%22%20sandbox%3D%22allow-same-origin%20allow-forms%22%20seamless%20width%3D%22240%22%20height%3D%22320%22%3E%3C/iframe%3E%3C/div%3E%3Cdiv%20class%3D%22frame%22%3E%3Ch2%3E320%3Cspan%3E%20x%20480%3C/span%3E%20%3Csmall%3E(mobile)%3C/small%3E%3C/h2%3E%3Ciframe%20src%3D%22%27%20%2B%20window.location%20%2B%20%27%22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String compress(String str) { | |
String result = ""; | |
List<String> nodes = new ArrayList<String>(); | |
Pattern pattern = Pattern.compile("(.)\\1{1,}"); | |
Matcher m = pattern.matcher(str); | |
int offset = 0; | |
while( m.find() ) { | |
int start = m.start(); | |
int end = m.end(); | |
OlderNewer