Skip to content

Instantly share code, notes, and snippets.

View danggrianto's full-sized avatar
🎯
Focusing

daniel anggrianto danggrianto

🎯
Focusing
  • philadelphia, PA
View GitHub Profile
@danggrianto
danggrianto / vim_cheatsheet
Created November 12, 2012 02:09
Vim cheat sheet
Delete Line dd
Delete everything after cursor dG

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@danggrianto
danggrianto / GridInfoExtractor.java
Created January 23, 2013 15:07
get ip address of grid node
package com.icims.webdriver.tool;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicHttpEntityEnclosingRequest;
import org.json.JSONException;
import org.json.JSONObject;
import org.openqa.selenium.remote.SessionId;
for(int i=0; i<3; i++){
try{
AdminPage adminPage = main.editPlatformSettings();
DriverWrapper.delay(1000);
}catch (Exception e){
DriverWrapper.delay(3000);
debug("Unable to change setting. Retrying ...");
continue;
}
break;
debug("create search template");
//use the first person as search template
SearchPage search = main.goToSearchPage(WebDriverUtils.SearchType.PERSON); //go to search page
search.doQuickSearch(includedInSearch.getFullName()); //do some quick search
search.saveSearchTemplate().createOrOverwriteTemplate(true,templateName ); //save search template
driver.switchToBase();
@danggrianto
danggrianto / BasicGUI.java
Last active December 23, 2015 10:49
basic GUI
public class BasicGUI {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel pane1 = new JPanel();
JPanel pane2 = new JPanel();
frame.add(pane1, BorderLayout.WEST);
frame.add(pane2, BorderLayout.EAST);
// JFrame frame = new JFrame ("Button Pannel");
x = input("Please input your first number : ")
y = input("Please input your second number : ")
print("Menu:")
print("1. Sum")
print("2. Subtract")
print("3. Multiply")
print("4. Divide")
print("5. Remainder of numbers")
print("6. Compare numbers")
x = input("Please input your first number : ")
y = input("Please input your second number : ")
while True:
print("Menu:")
print("1. Sum")
print("2. Subtract")
print("3. Multiply")
print("4. Divide")
print("5. Remainder of numbers")
def function():
print 'hello'
function()
knife cookbook upload vim
Uploading vim [1.1.2]
/Users/daniela/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:763:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)
from /Users/daniela/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:763:in `open'
from /Users/daniela/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:763:in `block in connect'
from /Users/daniela/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/timeout.rb:69:in `timeout'
from /Users/daniela/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/timeout.rb:100:in `timeout'
from /Users/daniela/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:763:in `connect'
from /Users/daniela/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:756:in `do_start'
from /Users/daniela/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:745:in `start'