Skip to content

Instantly share code, notes, and snippets.

View robertkraig's full-sized avatar
💭
I may be slow to respond.

Robert Kraig robertkraig

💭
I may be slow to respond.
View GitHub Profile
@robertrv
robertrv / gist:9710533
Created March 22, 2014 17:01
signiant after jsbeautifier
function retrieveEnvHostName() {
var injectedMstScriptTag = document.getElementById('ms-transfer-api');
var success = false;
var exceptionMsg;
if (injectedMstScriptTag == undefined || injectedMstScriptTag == null || injectedMstScriptTag == '') {
exceptionMsg = "Fatal error: Could not retrieve script tag ms-transfer-api!";
} else {
Signiant.Mst.envHostName = (injectedMstScriptTag).getAttribute('env-host-name');
if (Signiant.Mst.envHostName === undefined || Signiant.Mst.envHostName == null || Signiant.Mst.envHostName.length == 0) {
exceptionMsg = "Fatal error: Could not retrieve env-host-name from script tag ms-transfer-api!";
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active May 11, 2024 03:22
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
@insin
insin / contactform.js
Last active January 9, 2024 05:27
React contact form example
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({
@denji
denji / http-benchmark.md
Last active May 20, 2024 14:27
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@messified
messified / php-interview.md
Last active August 8, 2023 12:03
PHP Engineer Interview: What you should know

PHP Developer Interview: What you should know

1. What’s the difference between " self " and " this " ?

Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.

Source: When to use self vs this -stackoverflow

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@un33k
un33k / sed cheatsheet
Created August 22, 2011 13:28
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'