Skip to content

Instantly share code, notes, and snippets.

View Soulwest's full-sized avatar

Soulwest Soulwest

  • Antalya
View GitHub Profile
@Soulwest
Soulwest / addtogit.sh
Created November 26, 2016 23:35
Add directory to git
#!/bin/bash
DIR=$1
read -e -p "Enter git repo:" REPO
#echo $REPO
#echo $DIR
set -e
cd $DIR
# service nginx stop && certbot certonly --standalone -d ar2015.rosatom.ru -d rosatom15.downstream.ru && service nginx start
git submodule update --init --recursive
header('Access-Control-Allow-Origin: '.Request::initial()->headers('Origin'));
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
@Soulwest
Soulwest / screen.sh
Created July 6, 2018 16:20
Bash screen
screen -dR name
Disconnect: Ctrl+AD
@Soulwest
Soulwest / Kohana.xml
Created August 30, 2018 13:45
Kohana code style
<code_scheme name="Kohana" version="173">
<CssCodeStyleSettings>
<option name="BLANK_LINES_BETWEEN_BLOCKS" value="0" />
</CssCodeStyleSettings>
<HTMLCodeStyleSettings>
<option name="HTML_ATTRIBUTE_WRAP" value="0" />
<option name="HTML_TEXT_WRAP" value="0" />
<option name="HTML_ALIGN_ATTRIBUTES" value="false" />
</HTMLCodeStyleSettings>
<JSCodeStyleSettings>
@Soulwest
Soulwest / README.md
Last active April 21, 2024 20:25
POP OS Lenovo legion 5 pro (linux, ubuntu 21.10)
$('h1').each(function(k, v){
var shadows = getComputedStyle(v).textShadow;
console.log(shadows.replaceAll(', rgb', ",\nrgb"))
})
xboxdrv --evdev /dev/input/event30 --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RZ=x2,ABS_Z=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y --axismap -Y1=Y1,-Y2=Y2 --evdev-keymap BTN_NORTH=x,BTN_WEST=y,BTN_SOUTH=a,BTN_EAST=b,BTN_SELECT=back,BTN_START=start,BTN_TL=lb,BTN_TR=rb,BTN_TL2=lt,BTN_TR2=rt,BTN_THUMBL=tl,BTN_THUMBR=tr --mimic-xpad --silent &
@Soulwest
Soulwest / http.php
Created February 5, 2023 18:18
Code example
<?php
abstract class HTTP extends Kohana_HTTP {
/**
* The standard Kohana_HTTP::redirect raises Out of memory fatal error sometimes
*
* We don't need redirects in HMVC, so we can use the straight-forward approach instead of throwing exception
*/
public static function redirect($uri = '', int $code = 302) : void