Skip to content

Instantly share code, notes, and snippets.

View Hyra's full-sized avatar
🏠
Working from home

Stef van den Ham Hyra

🏠
Working from home
View GitHub Profile
@innocenzi
innocenzi / package.json
Last active April 1, 2023 13:01
Laravel + Vite + Inertia SSR
{
"scripts": {
"dev": "npx esno server.ts",
"build": "vite build",
"build:ssr": "vite build --ssr",
"build:all": "npm run build && npm run build:ssr"
}
}
@dotherightthing
dotherightthing / maschine-mk1-macos-10-15-7.md
Last active May 11, 2022 17:51
Setup instructions for the Maschine Mk1 controller with Maschine 2 on macOS Catalina 10.15.7

Setup instructions for the Maschine Mk1 controller with Maschine 2 on macOS Catalina 10.15.7

Background

I wanted to open my old Maschine projects created prior to travel in 2015. I picked up a second hand Maschine Mk1 for a good price.

There are compatability issues between Maschine Mk1 and macOS Catalina 10.15.7

Onboarding

@DJCordhose
DJCordhose / server-side-react-redux-router.js
Created September 20, 2015 11:58
React-redux-router: How to wait until all required actions have finished before rendering on the server side
export default function renderRoute(request, reply) {
const store = configureStore();
store.dispatch(match(request.path, (error, redirectLocation, routerState) => {
if (redirectLocation) {
reply.redirect(redirectLocation.pathname + redirectLocation.search);
} else if (error) {
reply(error.message).code(500);
} else if (!routerState) {
reply('Not found').code(404);
} else {
@jonathanstark
jonathanstark / verify-google-recaptcha-with-php
Last active March 8, 2024 18:24
Verify Google reCAPTCHA with PHP
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
@bzerangue
bzerangue / recursive-chmod.md
Last active November 22, 2022 23:09
Scripts for recursively chmod directories only and recursively chmod files only

Useful commands

You may find these commands useful when adjusting file and directory permissions.

To recursively chmod directories only:

find /your/site/root -type d -exec chmod 755 {} \;

To recursively chmod files only:

@mollerse
mollerse / gulpfile-express.js
Last active March 28, 2021 20:07
Gulpfile for livereload + static server
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserify = require('gulp-browserify'),
concat = require('gulp-concat'),
embedlr = require('gulp-embedlr'),
refresh = require('gulp-livereload'),
lrserver = require('tiny-lr')(),
express = require('express'),
livereload = require('connect-livereload')
livereloadport = 35729,
@LeBenLeBen
LeBenLeBen / _syntax.scss
Last active January 10, 2016 08:58
Pygments theme based on SublimeText theme "Spacegray" available here: https://github.com/kkga/spacegray
/**
* Syntax highlighting
* Colors from SublimeText theme "Spacegray"
* https://github.com/kkga/spacegray
*/
.highlight {
background-color: #343d46;
color: white;
@juniorconte
juniorconte / angular.scenario.dsl.cookies.js
Created September 29, 2013 09:02
DSL Extend to manipulate Cookies on e2e tests from AngularJs
'use strict';
angular.scenario.dsl('cookies', function() {
var chain = {};
chain.set = function(name,value) {
return this.addFutureAction('set cookie', function($window, $document, done) {
var injector = $window.angular.element($window.document.body).inheritedData('$injector');
var cookies = injector.get('$cookies');
var root = injector.get('$rootScope');
@istepanov
istepanov / gist:3950977
Created October 25, 2012 07:00
Remove PHPStorm settings from Mac OS X 10.8 Mountain Lion
#!/usr/bin/sh
rm -rf "$HOME/Library/Preferences/WebIde40"
rm -rf "$HOME/Library/Caches/WebIde40"
rm -rf "$HOME/Library/Application Support/WebIde40"
rm -rf "$HOME/Library/Logs/WebIde40"
@Abban
Abban / is-old-android.php
Created October 23, 2012 16:09
PHP Function to check Android version from the user agent.
/**
* Is Old Android
*
* Check to see it the user agent is Android and if so then
* check the version number to see if it is lower than 4.0.0
* or passed parameter
*
* @param string $version
* @return boolean
*/