Skip to content

Instantly share code, notes, and snippets.

View levlaz's full-sized avatar

Lev Lazinskiy levlaz

View GitHub Profile
@levlaz
levlaz / Dockerfile
Created December 22, 2016 23:40
Cardless Docker
FROM ruby:2.3.1
# Install Node 6.1
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt install -y nodejs
# Install other Apt Dependencies
RUN apt update
RUN apt install -y libicu-dev
@levlaz
levlaz / index.html
Created May 23, 2017 02:40
Thymeleaf Example
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>CircleCI Spring Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" th:href="@{/webjars/bootstrap/3.3.7/css/bootstrap.min.css}" />
<link rel="stylesheet" th:href="@{/css/style.css}" href="../static/css/style.css" />
</head>
@levlaz
levlaz / WebSecurityConfig.java
Created May 23, 2017 02:45
Spring Webjars Security Config
package com.circleci.demojavaspring;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@Configuration
# Please add your public key below
- name: postgres
containers:
- source: circleci-docker
image_name: circleci/postgres-script-enhance
version: ${circleci_postgres_script_enhance}
name: postgres
volumes:
- host_path: /data/circle/postgres/9.5/data
container_path: /var/lib/postgresql/data
env_vars:
@levlaz
levlaz / Hello.java
Created December 13, 2017 00:08
Time Based Event Rule
import com.launchdarkly.client.LDClient;
import com.launchdarkly.client.LDUser;
import java.io.IOException;
public class Hello {
public static void main(String... args) throws IOException {
LDClient client = new LDClient("YOUR_SDK_TOKEN");
@levlaz
levlaz / font-awesome-and-laravel.md
Last active March 4, 2025 23:54
How To Use Font Awesome With Laravel

For some reason there is a whole thread on this seemingly simple tasks. In a bootstrapped Laravel 5.4 instance the following worked for me.

Install Font Awesome with NPM

npm install font-awesome

Import font-awesome in your app.scss file

@levlaz
levlaz / db.py
Created December 22, 2017 02:01
Python + Sqlite DB Migration Example Code
def connect_db():
"""Connects to Database."""
rv = sqlite3.connect(
app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES | sqlite3.PARSE_COLNAMES)
rv.row_factory = sqlite3.Row
return rv
def get_db():
@levlaz
levlaz / cgitrc
Last active January 2, 2018 21:51
cgit Debian
#cgit config
#===========
#see cgitrc(5) for details
#=========================
css=/cgit.css
logo=/cgit.png
virtual-root=/
@levlaz
levlaz / ld.pl
Created February 5, 2018 19:27
LD Perl Example
#!/usr/bin/perl
use strict;
use warnings;
sub ShowFeature {
my ($key, $user) = @_;
ld_eval($key, $user);
};