Skip to content

Instantly share code, notes, and snippets.

M. Vugteveen it-can

  • IT Can
  • Borne
Block or report user

Report or block it-can

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@it-can
it-can / problem.txt
Last active Jul 2, 2019
Mariadb 10.4.6 problem
View problem.txt
CREATE TABLE `test_table` (
`age_from` tinyint(2) NOT NULL,
`age_to` tinyint(2) NOT NULL,
`gender` enum('M','V') NOT NULL,
`norm_min` float NOT NULL,
`norm_max` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `test_table`
ADD KEY `age_from` (`age_from`),
@it-can
it-can / ApiRespond.php
Created Nov 20, 2016 — forked from dugajean/ApiRespond.php
Trait for easy creation of API responses
View ApiRespond.php
<?php
namespace App\Traits;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
trait ApiRespond
{
/**
@it-can
it-can / supervisord.service
Last active Jun 22, 2017 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
View supervisord.service
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
View secure_osx.sh
sudo pmset -a destroyfvkeyonstandby 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist ProgramArguments -array-add "-NoMulticastAdvertisements"
sudo defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
sudo defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
sudo pmset -a hibernatemode 0
#sudo pmset -a hibernatemode 3
sudo defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.captive.control Active -bool false
View sri.go
package sri
import (
"crypto/sha256"
"encoding/base64"
"fmt"
"io/ioutil"
)
func Generate256(file string) (string, error) {
@it-can
it-can / pre-commit-dd
Last active May 22, 2016 — forked from martinbean/pre-commit
Pre-commit hook to detect if any files contain dd()
View pre-commit-dd
#!/usr/bin/php
<?php
function contains($needle, $haystack)
{
return stripos($haystack, $needle) !== false;
}
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD');
$files = explode("\n", trim($files));
@it-can
it-can / CacheRepository.php
Last active Sep 13, 2015 — forked from tillkruss/Database.php
[Laravel 5.1] Use Redis PECL/HHVM extension
View CacheRepository.php
<?php
namespace App\Repositories;
use Illuminate\Cache\Repository;
class CacheRepository extends Repository
{
public function has($key)
{
@it-can
it-can / Dnstransip.php
Last active Aug 29, 2015 — forked from lennartvdd/transip-dyndns.php
TransIP API DynDNS
View Dnstransip.php
<?php
// SETTINGS
// The domain to edit
define('DOMAIN', 'example.com');
// The authentication key
define('KEY', '69l67Le20e819360d3YHO1175');
// The DNS entries to update (name => content)
// This script will NOT add new entries
View gist:62f9ec61bdae56221a9a

The Laracasts PHPStorm theme - modified.

This is a slightly modified version of the great Laracasts PHPStorm theme. I've added some styles for Verions Control (add, modified, deleted line...) and fixed some missing things like warnings.

Download

image

Mac: Add to ~/Library/Preferences/WebIde80/colors

You can’t perform that action at this time.