Skip to content

Instantly share code, notes, and snippets.

View megabites2013's full-sized avatar

SebastianX3024915 megabites2013

View GitHub Profile
@megabites2013
megabites2013 / Install_tmux
Created March 28, 2016 19:42 — forked from simme/Install_tmux
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@megabites2013
megabites2013 / GebDemoSpec.groovy
Created October 1, 2018 22:03 — forked from arttuladhar/GebDemoSpec.groovy
REST API Testing Using Spock
package specs
import geb.spock.GebReportingSpec
class GebDemoSpec extends GebReportingSpec {
def "Testing Basic Page Contents"(){
setup:
go "http://localhost:9000/#/demo/geb-demo"
---------------------------------------------------------
-- Boilerplate mocking out what we already have today. --
-- Just scroll down to the bottom. --
---------------------------------------------------------
-- Cleanup
drop table if exists
import_log,
my_data_source,
meta_record,
@megabites2013
megabites2013 / PageableCollection.java
Created February 18, 2020 11:15 — forked from josericardo/PageableCollection.java
Helper to iterate over pageable sources. Should reduce memory usage when querying large tables via Spring Data.
======================================
Usage:
Fetcher<Source, MyEntity> f = new Fetcher<Source, MyEntity>(source) {
@Override
public List<MyEntity> fetch(Pageable pageRequest)
{
return source.findAll(pageRequest);
}
};
@megabites2013
megabites2013 / mockActivatedRoute.ts
Created March 4, 2020 21:24 — forked from benjamincharity/mockActivatedRoute.ts
Mock ActivatedRoute with params, data and snapshot.
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MdToolbarModule,
],
providers: [
{
provide: Router,
useClass: MockRouter,
},
@megabites2013
megabites2013 / server.js
Created July 10, 2021 13:09 — forked from joshj/server.js
Twitter OAuth with node-oauth for node.js+express
/*
Node.js, express, oauth example using Twitters API
Install Node.js:
curl -0 http://nodejs.org/dist/v0.6.11/node-v0.6.11.tar.gz
tar -zxf node-v0.6.11.tar.gz
cd node-v0.6.11
./configure
make
make install