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"
@megabites2013
megabites2013 / grails create-app --profile angularjs > build.gradle
Last active October 27, 2018 08:09
build.gradle < grails create-app --profile angularjs
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "gradle.plugin.com.craigburke.gradle:karma-gradle:1.4.3"
classpath "com.craigburke.gradle:client-dependencies:1.3.1"
classpath "org.grails.plugins:angularjs-scaffolding:1.0.3"
@megabites2013
megabites2013 / grails Forge 3.3.8 --angularjs > build.gradle
Created October 27, 2018 08:50
build.gradle < grails Forge 3.3.8 --angularjs
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "gradle.plugin.com.craigburke.gradle:karma-gradle:1.4.3"
classpath "com.craigburke.gradle:client-dependencies:1.3.1"
classpath "org.grails.plugins:angularjs-scaffolding:1.0.3"
---------------------------------------------------------
-- 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,
},
using System;
class MainClass
{
static void Main (string[] args)
{
string secretWord = "Nicholas";
string guess = "";
int guesscount = 0;
while(guess != secretWord){
def pow (baseNum, powNum)
result = 1
powNum.times do |index|
result = result * baseNum
end
return result
end
puts pow(2,3)
fn main(){
println!("Hello from print.rs");
println!(
"{0} is from {1} and {0} likes to {2}",
"Nicholas",
"Stockholm",
"code"
);
println!(
"{name} likes to play {game}",