Skip to content

Instantly share code, notes, and snippets.

@JuanJo4
JuanJo4 / app.js
Last active September 26, 2020 21:53
Twitter OAuth with node-oauth for node.js + express 4
/*
Node.js, express, oauth example using Twitters API
Install Dependencies:
npm install express
npm install oauth
Create App File:
Save this file to app.js
@JuanJo4
JuanJo4 / capybara cheat sheet
Created November 17, 2012 04:54 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
nano /usr/share/applications/name.desktop
# PASTE the following /usr/share/applications/name.desktop
[Desktop Entry]
Encoding=UTF-8
Name=name
Comment=comment
Exec=name_shortcut
Icon=/path/folder/icon.png
@JuanJo4
JuanJo4 / dimensiones-monitor.java
Created July 2, 2011 05:45
Capturar las dimensiones del monitor
import javax.swing.JFrame;
import java.awt.Dimension;
import java.awt.Toolkit;
final JFrame frame = new JFrame();
Dimension fullscreen = Toolkit.getDefaultToolkit().getScreenSize();
fullscreen.width -= 100;
fullscreen.height -= 200;
frame.setBounds(0,0,fullscreen.width,fullscreen.height);