Skip to content

Instantly share code, notes, and snippets.

😀
Working from home lately

George Jempty dexygen

😀
Working from home lately
Block or report user

Report or block dexygen

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
@noelboss
noelboss / git-deployment.md
Last active Nov 20, 2019
Simple automated GIT Deployment using Hooks
View git-deployment.md

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@sebmarkbage
sebmarkbage / Enhance.js
Last active Oct 19, 2019
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@zapthedingbat
zapthedingbat / logeverything.js
Created Aug 19, 2014
Log every function call to the console
View logeverything.js
(function() {
var call = Function.prototype.call;
Function.prototype.call = function() {
console.log(this, arguments);
return call.apply(this, arguments);
};
}());
@noodlehaus
noodlehaus / web_app.php
Last active Dec 15, 2017
bare bones routing function for PHP.
View web_app.php
<?php
// minimal routing
function web_app($routes, $req_verb, $req_path) {
$req_verb = strtoupper($req_verb);
$req_path = trim(parse_url($req_path, PHP_URL_PATH), '/');
$found = false;
if (isset($routes[$req_verb])) {
@dexygen
dexygen / meek.js
Last active Dec 20, 2015
Genuinely Unobtrusive Javascript
View meek.js
(function(scope) {
function destroyAutoGlobals(options) {
var allElements = document.getElementsByTagName("*"), elementId;
for (var i=allElements.length; i--; ) {
elementId = allElements[i].id;
if (elementId && window[elementId] instanceof HTMLElement) {
options && options.verbose && console.log('Destroying window["' + elementId + '"]');
window[elementId] = null;
@derickbailey
derickbailey / 1.html
Created Apr 11, 2012
modal dialog with backbone
View 1.html
<script id="modal-view-template" type="text/html">
<div class="modal-header">
<h2>This is a modal!</h2>
</div>
<div class="modal-body">
<p>With some content in it!</p>
</div>
<div class="modal-footer">
<button class="btn">cancel</button>
<button class="btn-default">Ok</button>
@eriwen
eriwen / qunit-to-junit-for-phantom.js
Created Nov 14, 2011
JUnit XML output for QUnit tests compatible with PhantomJS 1.3
View qunit-to-junit-for-phantom.js
var module, moduleStart, testStart, testCases = [],
current_test_assertions = [];
console.log('<?xml version="1.0" encoding="UTF-8"?>');
console.log('<testsuites name="testsuites">');
QUnit.begin = function() {
// That does not work when invoked in PhantomJS
}
QUnit.moduleStart = function(context) {
moduleStart = new Date();
@dmitry
dmitry / backbone-mixin.js
Created Oct 1, 2011 — forked from wesen/backbone-mixin.js
Merge backbone views (mixin pattern)
View backbone-mixin.js
/**
* ## Merging mixin views in backbone.js ##
*
* really just more a test for tumblr gistr
*/
/**
* Merge the mixin (a Backbone.View) into another Backbone.View. Automatically merge events, defaults, and call the parent initializer.
**/
function mergeMixin(view, mixin) {
@isa
isa / MultiLineString.java
Created Mar 20, 2011
Demonstrates how you can do multi-line string literals in java.. It's very good especially for unit-testing.
View MultiLineString.java
// More info: http://blog.efftinge.de/2008/10/multi-line-string-literals-in-java.html
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class MultilineStringDemo {
public static String S() {
View Super Form Reset.css
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs
You can’t perform that action at this time.