Skip to content

Instantly share code, notes, and snippets.

View marcj's full-sized avatar
🖌️
Data

Marc J. Schmidt marcj

🖌️
Data
View GitHub Profile
@immutef
immutef / ValidationFailedExceptionListener.php
Created October 4, 2014 13:55
Validation Exception Listener
<?php
namespace App\Listener\Exception;
use App\Exception\ValidationFailedException;
use JMS\DiExtraBundle\Annotation as DI;
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
@marcj
marcj / gist:dda218b489cedc5cc3e8
Last active May 18, 2016 21:09
AngularJS Cheatsheet

AngularJS Cheatsheet

Pitfalls

Scope does not detect changes with whitespace at the end and beginning

A: You need to set ng-trim to false.

   <input ng-model="model.name" ng-trim="false />
@pete-otaqui
pete-otaqui / css-onload.js
Created October 18, 2012 14:42
Load External Domain CSS, and get a Callback in IE7, IE8, IE9, FF, Chrome & Safari
function cssLoad(url, callback) {
var promise,
resolutions = [],
rejections = [],
resolved = false,
rejected = false,
count, id;
@DavidFrahm
DavidFrahm / gist:4409d6b74e46377e7be7
Created January 27, 2015 22:58
Ionic build iOS app for release, open in HockeyApp for deploying to team
#!/bin/bash
echo "Building Ionic/Cordova iOS release..."
ionic build --release ios
# Save current directory and cd to other dir
pushd platforms/ios/
# Build archive
xcodebuild -scheme "MyApp" -configuration Release clean archive
# Can also specify archive path:
@binwiederhier
binwiederhier / README.md
Last active January 27, 2018 08:31
OpenSSH 6.6p1 patch: AuthorizedKeysCommand with additional argument <fingerprint>

Make and run

apt-get source openssh-server
apt-get install libssl-dev 
cd openssh-6.6p1

# Apply patch
patch -p1 openssh/openssh-6.6p1/auth2-pubkey.c < auth2-pubkey.c.patch
@TooTallNate
TooTallNate / webfont-manual.js
Created July 29, 2010 18:20
Adds a "manual" module to the WebFontLoader JS library, to dynamically create @font-face nodes.
webfont.DomHelper.prototype.setCssStyle = function(styleNode, body) {
if (styleNode.styleSheet) {
styleNode.styleSheet.cssText = body;
} else {
styleNode.appendChild(this.document_.createTextNode(body));
}
return styleNode;
}
/**
import sys
import collections
import gridfs
import io
import psycopg2
import pymongo
import random
import time
# For fairness use the same chunk size - 512k.
@marcj
marcj / do-it.sh
Last active April 12, 2020 08:47
OSX PhpStorm, better performance - more FPS using OpenGL
cp /Applications/PhpStorm.app/Contents/bin/phpstorm.vmoptions ~/Library/Preferences/WebIde*
echo -ne "\n-Dawt.useSystemAAFontSettings=lcd\n-Dawt.java2d.opengl=true" >> ~/Library/Preferences/WebIde*/phpstorm.vmoptions
@marcus-sa
marcus-sa / client-and-server.spec.ts
Last active May 23, 2022 22:17
Deepkit WebSocket RPC Cloudflare Workers Interconnection
import { createTestingApp } from '@deepkit/framework';
import { ControllerSymbol, rpc } from '@deepkit/rpc';
import { entity } from '@deepkit/type';
import {
webSocketFetchRequestHandler,
CloudflareWorkerRpcWebSocketClient,
} from '../src';
// https://miniflare.dev/testing/jest
@shimondoodkin
shimondoodkin / WebKit contentEditable focus bug workaround.html
Created July 13, 2011 19:28
WebKit contentEditable focus bug workaround
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>WebKit contentEditable focus bug workaround</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.6.2.js'></script>
<script type='text/javascript'>
//<![CDATA[
$(function(){