Skip to content

Instantly share code, notes, and snippets.

View Vlasterx's full-sized avatar
🛸
Working from mothership

vlasterx Vlasterx

🛸
Working from mothership
  • Belgrade, Serbia
  • 17:08 (UTC +02:00)
View GitHub Profile
@Vlasterx
Vlasterx / SassMeister-input.scss
Last active November 23, 2015 12:49
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// _____ _ _ _
// | | |___ ___|_|___| |_| |___ ___
// | | | .'| _| | .'| . | | -_|_ -|
// \___/|__,|_| |_|__,|___|_|___|___|
@Vlasterx
Vlasterx / SassMeister-input.scss
Last active March 20, 2019 08:57
Generated by SassMeister.com.
// ----
// libsass (v3.5.4)
// ----
// MEDIA mixin example
// ---------------------------------------------------------
// Variables
$baseline-ratio: 1.618 !global;
@Vlasterx
Vlasterx / SassMeister-input.scss
Last active February 23, 2016 18:42
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$resolutions: (
mobile: (
name: "mobile",
shortName: "m",
baseFontSize: 13px,
breakpointStart: 320px,
<fieldset name="ADMIN_TEST">
<field name="access" type="accesslevel" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC" class="span12 small" />
<field name="cache_handler" type="cachehandler" default="" label="Cache Handler Field type" description="COM_CONFIG_FIELD_CACHE_HANDLER_DESC" filter="word" />
<field name="mycalendar" type="calendar" default="5-10-2008" label="Select a date" description="" format="%d-%m-%Y" />
<field name="captcha" type="plugins" folder="captcha" label="Captcha Selection field" description="COM_CONTACT_FIELD_CAPTCHA_DESC" default="" filter="cmd">
<option value="">JOPTION_USE_DEFAULT</option>
<option value="0">JOPTION_DO_NOT_USE</option>
</field>
<field name="mycategory" type="category" extension="com_content" label="Select a category" description="" />
<field name="show_title" type="checkbox" label="Show title" description="Show the title of the item" value="1" />
@Vlasterx
Vlasterx / csv2json.php
Created August 13, 2016 12:11
PHP: CSV to JSON
<?php
/*
You can rename this file to .JSON and add .htaccess with this content:
<Files *.json>
ForceType application/x-httpd-php
</Files>
*/
// CSV File
@Vlasterx
Vlasterx / C64-floppy.svg
Created August 21, 2016 21:41
C64 floppy SVG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# 300 5 MIN
# 600 10 MIN
# 900 15 MIN
# 1800 30 MIN
# 2700 45 MIN
# 3600 1 HR
# 7200 2 HR
# 10800 3 HR
# 14400 4 HR
# 18000 5 HR
@Vlasterx
Vlasterx / .htaccess
Created October 18, 2016 11:03
Common .htaccess with HTTPS enforcing, WWW redirection and common exploit blocking
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
## Begin - Check site protocol HTTP or HTTPS
# initialization code - put only once at the beginning of .htaccess
# then use %{ENV:proto} in your rules
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"' [OR]
@Vlasterx
Vlasterx / installNodeJs.bash
Created October 18, 2016 16:02
Installing Node on Debian 8
wget https://nodejs.org/dist/v4.6.0/node-v4.6.0-linux-x64.tar.xz
tar -xJf node-v4.6.0-linux-x64.tar.xz && cd node-v4.6.0-linux-x64
cp ./bin/node /usr/local/bin/node
cp -r ./lib/node_modules /usr/local/lib/node_modules
ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
cp -r ./include/node /usr/local/include
mkdir -p /usr/local/man/man1 && cp ./share/man/man1/node.1 /usr/local/man/man1/node.1
@Vlasterx
Vlasterx / print_r_reverse.php
Created February 28, 2017 19:12
print_r REVERSE
http://www.php.net/manual/en/function.print-r.php#93529
<?php
function print_r_reverse($in) {
$lines = explode("\n", trim($in));
if (trim($lines[0]) != 'Array') {
// bottomed out to something that isn't an array
return $in;
} else {
// this is an array, lets parse it