Skip to content

Instantly share code, notes, and snippets.

View zoozalp's full-sized avatar

Zekai Oğuz Özalp zoozalp

View GitHub Profile
@import "~antd/lib/style/index";
.container {
width: 100%;
display: flex;
align-self: center;
margin: auto;
}
.make-container(@minWidth, @breakpoint) {
@zoozalp
zoozalp / HoistNonReactStatic.js
Last active July 13, 2019 09:02
Hoist Non-React Static
import React from 'react';
import hoistNonReactStatic from 'hoist-non-react-statics';
import Context from './Context';
function withInAppNotification(WrappedComponent) {
class Enhanced extends React.PureComponent {
render() {
return (
@zoozalp
zoozalp / srd_5e_monsters.json
Created April 18, 2019 14:36 — forked from tkfu/srd_5e_monsters.json
A JSON file with all the D&D 5e SRD monster data
[
{
"name": "Aboleth",
"meta": "Large aberration, lawful evil",
"Armor Class": "17 (Natural Armor)",
"Hit Points": "135 (18d10 + 36)",
"Speed": "10 ft., swim 40 ft. ",
"STR": "21",
"STR_mod": "(+5)",
"DEX": "9",
@zoozalp
zoozalp / last_password_reset_date.sql
Created April 24, 2018 07:22
Add last password reset date to users table
alter table users add last_password_reset_date timestamp;
update users set last_password_reset_date = current_date;
alter table users alter column last_password_reset_date set not null;
@zoozalp
zoozalp / headless-android-sdk.sh
Last active April 15, 2018 18:27
Install Android SDK on a headless Ubuntu Server
#!/bin/bash
# Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7
# Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n
# Install Oracle JDK 8
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
apt-get install -y unzip make # NDK stuff
@zoozalp
zoozalp / certbot
Created February 7, 2018 21:18
certbot install ssl
sudo certbot --authenticator standalone --installer nginx --pre-hook "nginx -s stop" --post-hook "nginx"
@zoozalp
zoozalp / search_fields.sql
Created January 13, 2018 09:54
Find tables and fields in sql server database
SELECT
t.name AS 'Table',
c.name AS 'Column'
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE lower(t.name) LIKE '%fis%'
OR lower(c.name) LIKE '%fis%'
ORDER BY 1,2
@zoozalp
zoozalp / spring_session.sql
Created September 30, 2017 12:37
Create spring session tables
CREATE TABLE SPRING_SESSION (
SESSION_ID CHAR(36) NOT NULL,
CREATION_TIME BIGINT NOT NULL,
LAST_ACCESS_TIME BIGINT NOT NULL,
MAX_INACTIVE_INTERVAL INT NOT NULL,
PRINCIPAL_NAME VARCHAR(100),
CONSTRAINT SPRING_SESSION_PK PRIMARY KEY (SESSION_ID)
);
CREATE INDEX SPRING_SESSION_IX1 ON SPRING_SESSION (LAST_ACCESS_TIME);
@zoozalp
zoozalp / create_psql_user_and_db
Last active September 17, 2017 10:34
Create new postgresql user and database
CREATE USER <new_username> with PASSWORD '<password>';
CREATE DATABASE <new_database_name>;
GRANT ALL PRIVILEGES ON DATABASE <new_database_name> TO <new_username>;
@zoozalp
zoozalp / update ubuntu bash script
Last active September 7, 2017 20:10
nano ~/.bashrc
update() {
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
}