Skip to content

Instantly share code, notes, and snippets.

View LetItRock's full-sized avatar
👨‍💻
coding...

Paweł Tymczuk LetItRock

👨‍💻
coding...
View GitHub Profile
@LetItRock
LetItRock / new_gist_file_0
Created December 25, 2014 20:21
This is simple package.json file for npm From http://codybonney.com/simple-package-json-file-for-npm/
{ "name": "json-lint-express", "preferGlobal": true, "version": "0.0.1", "author": "Cody Bonney <me@codybonney.com>", "description": "a simple web server that lints json strings", "license": "MIT", "engines": { "node": ">=0.10" }, "scripts": { "start": "node ./app.js" }, "dependencies": { "express": "~3.4.7", "json-lint": "~0.1.0" } }
{ "keys": ["ctrl+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
{ "keys": ["ctrl+right"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
{ "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
{ "keys": ["ctrl+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
{ "keys": ["alt+left"], "command": "move", "args": {"by": "words", "forward": false} },
{ "keys": ["alt+right"], "command": "move", "args": {"by": "word_ends", "forward": true} },
{ "keys": ["alt+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} },
{ "keys": ["alt+shift+right"], "command": "move", "args": {"by": "word_ends", "forward": true, "extend": true} },
@LetItRock
LetItRock / new_gist_file_0
Created December 27, 2014 16:11
Sublime text 2 key bindings for scrolling down/up page From http://stackoverflow.com/questions/14286259/scroll-using-the-keyboard
{ "keys": ["ctrl+up"], "command": "scroll_lines", "args": {"amount": 1.0} },
{ "keys": ["ctrl+down"], "command": "scroll_lines", "args": {"amount": -1.0} },
@LetItRock
LetItRock / scrollToWithNiceEffect
Created January 8, 2015 22:58
Nice scroling effect
var $scope, $location;
var app = angular.module('app', []);
app.service('anchorSmoothScroll', function(){
this.scrollTo = function(eID) {
// This scrolling function
// is from http://www.itnewb.com/tutorial/Creating-the-Smooth-Scroll-Effect-with-JavaScript
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1>
<div class="account-wall">
<img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form class="form-signin">
<input type="text" class="form-control" placeholder="Email" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
body {
padding-top: 40px;
}
header {
background: #f5b335;
height: 40px;
position: fixed;
top: 0;
transition: top 0.3s ease-in-out;
@LetItRock
LetItRock / persistanceContext.java
Created March 18, 2015 18:36
Spring + Postgresql + JPA + OPENSHIFT
@Configuration
@ComponentScan(basePackages = "com.shekhar.notebook")
@EnableJpaRepositories(basePackageClasses = NotebookRepository.class)
@EnableTransactionManagement
public class ApplicationConfig {
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
vendorAdapter.setDatabase(Database.POSTGRESQL);
@LetItRock
LetItRock / TimerTask
Created April 10, 2015 09:26
Run some code later
new Timer().schedule(new TimerTask() {
@Override
public void run() {
}
}, 80000);
@LetItRock
LetItRock / ReadFileFromClasspath
Last active August 29, 2015 14:18
Read file from classpath
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("META-INF\\teamdev.licenses")));
System.out.println("------------------------------------");
System.out.println("Text from file: ");
String string = null;
while ((string = reader.readLine()) != null) {
System.out.println(string);
}
System.out.println("------------------------------------");