Skip to content

Instantly share code, notes, and snippets.

@Gerst20051
Gerst20051 / .jshintrc
Last active August 29, 2015 14:11 — forked from artanisdesign/.jshintrc
Titanium .jshintrc
{
"bitwise": true,
"camelcase": true,
"eqeqeq": true,
"newcap": true,
"indent": 4,
"unused": true,
"onevar": true,
"undef": true,
"trailing": true,
@Gerst20051
Gerst20051 / ruleset.xml
Created January 16, 2015 20:35
PHP CodeSniffer Ruleset
<?xml version="1.0"?>
<ruleset name="AG">
<description>The Coding Standard.</description>
<arg name="tab-width" value="4"/>
<!-- PSR2 -->
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceAfterCloseBracket">
@Gerst20051
Gerst20051 / Swift Strings In JavaScript.js
Last active August 29, 2015 14:18
Swift Strings Interpolation In JavaScript
// http://jsfiddle.net/gerst20051/zhzuwoqe/
var language = 'swift';
var how_awesome = 'very awesome!!';
var string = 'hey i\'m a \\(language) string in disguise. \\(how_awesome)';
function parseString(data) {
var re = /\\\((.*?)\)/g;
return data.replace(re, function(match) {
return eval(match.replace(/\\/g, '').replace(/\(/g, '').replace(/\)/g, ''));
@Gerst20051
Gerst20051 / jscsrc.json
Last active August 29, 2015 14:22
JavaScript Code Style .jscsrc
{
"disallowEmptyBlocks": true,
/*"disallowDanglingUnderscores": true,*/
"disallowKeywords": [
"with"
],
"disallowKeywordsOnNewLine": [
"else"
],
"disallowMixedSpacesAndTabs": true,
@Gerst20051
Gerst20051 / jshintrc.json
Created June 5, 2015 15:42
JavaScript Hint .jshintrc
{
// JSHint Configuration File
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@Gerst20051
Gerst20051 / filter-github-feed.js
Last active August 29, 2015 14:23
Filter Github Feed
var clickIntervalId = setInterval(function () {
$('.js-events-pagination').click();
}, 2E3);
setTimeout(function () {
clearInterval(clickIntervalId);
$('.news').find('.create, .fork, .public, .issues_opened, .member_add').remove() &&
$('.watch_started').find('.title').find('a:eq(1):not(:contains("dynamics.js"))').closest('.watch_started').remove();
}, 20E3);
@Gerst20051
Gerst20051 / eslintrc.yml
Created July 17, 2015 15:36
JavaScript ESLint .eslintrc
rules:
indent:
- 2
- 4
quotes:
- 2
- single
linebreak-style:
- 2
- unix
@Gerst20051
Gerst20051 / permutation.class.php
Created August 17, 2015 22:04
Permutation PHP Class
<?php
$permutation = new Permutation();
// $permutation = new Permutation(array_rand(range(0, 100), 4));
class Permutation
{
private $data = [];
private $permutations = [];
@Gerst20051
Gerst20051 / hash.js
Created November 11, 2015 16:44
Hash Utils
window.Hash = {
query: {},
getHash: function () {
return decodeURIComponent(window.location.hash.substring(1));
},
clearHash: function () {
window.location.replace('#');
},
setHash: function (hash) {
window.location.replace('#' + encodeURI(hash));