Skip to content

Instantly share code, notes, and snippets.

View scsskid's full-sized avatar
:octocat:

Benedikt Gregor scsskid

:octocat:
View GitHub Profile
-----__o
---_\ <,
--(_)/(_)
@scsskid
scsskid / README.md
Last active July 29, 2020 05:38
Date get Monday as 0th day, src: https://stackoverflow.com/a/24481597/2823589
@scsskid
scsskid / ffmpeg-receipes.sh
Last active April 15, 2021 16:56
[ffmpeg cookbook] #bash #ffmpeg
# https://stackoverflow.com/a/53269551
ffmpeg -f concat -safe 0 -i <(for f in ./*.mp4; do echo "file '$PWD/$f'"; done) -c copy output.mp4
# convert .mov to .mp4
# https://mrcoles.com/convert-mov-mp4-ffmpeg/
ffmpeg -i videoName.mov -vcodec h264 -acodec mp2 videoName.mp4
ffmpeg -i input.flv -vcodec libx264 -acodec aac output.mp4
@scsskid
scsskid / introrx.md
Created July 7, 2020 09:46 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@scsskid
scsskid / .htaccess
Created February 27, 2020 17:57 — forked from davemackintosh/.htaccess
Working .htaccess for Single Page Apps
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.html [QSA,L]
</ifModule>
@scsskid
scsskid / README.md
Last active July 29, 2020 07:46 — forked from chuckreynolds/wordpress-change-domain-migration.sql
Wordpress Change Domain SQL Commands

Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: always backup your database. __STEP2: change the ‘oldsite.com’ and ‘newsite.com’ variables to your own. _STEP3: make sure your database prefix is “wp”, if it’s not then you’ll want to go through and change the prefix in each line to whatever yours is. __STEP4: copy the modified variables and the queries and paste it into phpMyAdmin or, better yet, SequelPro and run it on your database. TEST. DONE. __Changelog: — updated queries to use variables instead of editing the urls in many different areas — commented out GUID and left as optional. shouldn’t reset those. ref: codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note

@scsskid
scsskid / debug-to-console.php
Last active August 30, 2019 09:25
Debug PHP to Console JSON
<?php
function debug_log($object = null, $label = null)
{
$message = json_encode($object, JSON_PRETTY_PRINT);
$label = "Debug" . ($label ? " ($label): " : ': ');
echo "<script>console.log(\"$label\", $message);</script>";
}
// Utility function
function Util () {};
/*
class manipulation functions
*/
Util.hasClass = function(el, className) {
if (el.classList) return el.classList.contains(className);
else return !!el.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)'));
};
@scsskid
scsskid / utils.js
Created June 29, 2019 15:21
Misc Utility Funcs
// Utility function
function Util () {};
/*
class manipulation functions
*/
Util.hasClass = function(el, className) {
if (el.classList) return el.classList.contains(className);
else return !!el.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)'));
};
@scsskid
scsskid / getTransitionEndEventName.js
Created June 20, 2019 17:57
get name of Transitionend event for current browser, src: https://stackoverflow.com/q/12250329/2823589
var whichTransitionEvent = (function (){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition' :'transitionEnd',
'OTransition' :'oTransitionEnd',
'MSTransition' :'msTransitionEnd',
'MozTransition' :'transitionend',
'WebkitTransition' :'webkitTransitionEnd'
}