Skip to content

Instantly share code, notes, and snippets.

View Benjaminhu's full-sized avatar
🚀
To infinity and beyond.

Simon Benjámin Benjaminhu

🚀
To infinity and beyond.
View GitHub Profile
@quonic
quonic / scum_sqlite.ps1
Last active September 3, 2022 22:16
For the game SCUM. This sets stats too 5 and skills to 4 for specified character.
#Requires -Module PSSQLite
param(
[Alias('Name', '')]
[string]
$ProfileName
)
<#
Updated for 9/2 patch
Updated by request of Truth91
#>
@luukverhoeven
luukverhoeven / phpstorm.vmoptions
Last active January 31, 2025 18:04
My Phpstorm vmoptions + idea.properties
-ea
-server
-Xms512m
-Xmx2g
-XX:ParallelGCThreads=8
-XX:PermSize=350m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:LargePageSizeInBytes=256m
-XX:+UseConcMarkSweepGC
@spagu
spagu / pre-commit
Last active November 19, 2020 22:57
subversion pre-commit hook for PHP lint, PSR-2 and CSS validation + comments
#!/bin/sh
# SVN PRE-COMMIT HOOK
#
# Requirements:
# - PHP installed ( https://secure.php.net/manual/en/install.php )
# - PHPCS installed ( https://github.com/squizlabs/PHP_CodeSniffer + https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards )
# - csslint installed ( https://github.com/CSSLint/csslint/wiki/command-line-interface )
# - i18n0lint installed ( https://github.com/jwarby/i18n-lint )
Parameters:
InstanceImageIdParameter:
Type: AWS::EC2::Image::Id
Default: 'ami-5055cd3f'
InstanceTypeParameter:
Type: String
Default: t2.micro
InstanceKeyNameParameter:
Type: String
InstanceNameParameter:
@NBZ4live
NBZ4live / 2018_02_07_101510_migrate_to_utf8mb4.php
Created February 7, 2018 11:56
Laravel migration to migrate the database from utf8 to utf8mb4
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MigrateToUtf8mb4 extends Migration
{
/**
* Run the migrations.
@lsloan
lsloan / Copy Bitbucket repo to GitHub.md
Last active February 16, 2025 17:44 — forked from mandiwise/Update remote repo
Copy Bitbucket repo to GitHub

Copy Bitbucket repo to GitHub

Whenever possible, use GH's "Import repository" feature.

The import feature doesn't always work, though. In my experience, I tried to import a repo and it failed with a generic message. I had to contact GH support to ask for help. They told me my repo had a large file (>100MB), which couldn't be added to GH directly. I had to either remove the file or store it in GH LFS. In this case, one of the CLI methods below are needed:

CLI: Copy the master branch only (OK)

@zplume
zplume / MutationObserverVsDOMSubtreeModified.js
Created November 6, 2017 11:06
MutationObserver vs DOMSubtreeModified example which allows detecting changes in elements that don't exist yet, by detecting changes in a parent element that does exist at the time the function is executed.
// This example depends on jQuery().on and _.debounce
// Create a MutationObserver to trigger a callback function
// when the element located via document.querySelector(elementSelector) changes
function getMutationObserver(elementSelector, callback) {
var observer = new MutationObserver(callback);
var config = { attributes: true, childList: true, characterData: false };
observer.observe(document.querySelector(elementSelector), config);
return observer;
@Yousha
Yousha / .gitattributes
Last active March 8, 2023 11:17
.gitattributes for PHP developers.
* text=auto
###### Git
.gitattributes text
.gitignore text
.gitconfig text
.gitmodules text
##### Windows
*.bat text eol=crlf
@anvk
anvk / psql_useful_stat_queries.sql
Last active February 17, 2025 18:48
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@vinsim24
vinsim24 / findExamples.sh
Created September 23, 2017 18:50
Bash Find Examples
#!/bin/bash
#Find all link files
ls -ltr `find . -maxdepth 1 -type l -print`
#Find and remove all files whose modified time is greater than 30 days
find . -type f -mtime +30 -exec rm {} \;
#Find particular word across files in same directory
find . -type f | xargs grep -l "searched_word"