Skip to content

Instantly share code, notes, and snippets.

View borys-kupar's full-sized avatar
🇺🇦
#StandWithUkraine

Borys Kupar borys-kupar

🇺🇦
#StandWithUkraine
View GitHub Profile
@AsaAyers
AsaAyers / crowd.php
Created July 31, 2011 00:17
PHP Crowd Authentication
<?php
/**
* This file demonstrates using Atlassian Crowd for Single Sign On.
*/
$crowd_app_name = 'REMOVED';
$crowd_app_password = 'REMOVED';
$crowd_url = 'http://crowd.REMOVED.com/crowd/services/SecurityServer?wsdl';
// http://pear.php.net/package/Services_Atlassian_Crowd
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@Craga89
Craga89 / ios-version.js
Created May 29, 2012 16:39
JavaScript iOS version detection
/*
* Outputs a float representing the iOS version if user is using an iOS browser i.e. iPhone, iPad
* Possible values include:
* 3 - v3.0
* 4.0 - v4.0
* 4.14 - v4.1.4
* false - Not iOS
*/
var iOS = parseFloat(
@ghiden
ghiden / bargraph.css
Last active May 29, 2024 01:29
D3.js bar graph example
.chart {
background: #b0e0f8;
margin: 5px;
}
.chart rect {
stroke: white;
fill: steelblue;
}
@alexbeletsky
alexbeletsky / Feedback.js
Created December 18, 2012 19:07
Backbone.View done with TDD
var Feedback = Backbone.Model.extend({
url: '/feedback',
validate: function (attrs) {
var errors = [];
if (!attrs.email || attrs.email === '') {
errors.push({name: 'email', message: 'Please fill email field.'});
}
@lvivski
lvivski / jquery.mini.js
Created April 19, 2013 07:19
jQuery mini
function $(selector, context) {
return (context || document).querySelector(selector)
}
$.all = function (selector, context) {
return Array.prototype.slice.call(
(context || document).querySelectorAll(selector)
)
}
@mudge
mudge / eventemitter.js
Last active July 2, 2024 13:06
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;
// Check if IE8 or lower
isOldIE: document.documentElement.className.search('old-ie') >= 0,
// Force IE8 to redraw :before/:after pseudo elements
// http://stackoverflow.com/questions/9809351/
redrawPseudoEls: function() {
var self = this;
if ( self.isOldIE ) {
console.log('redraw pseudo elements');
var head = document.getElementsByTagName('head')[0],
@roman01la
roman01la / app.js
Last active August 29, 2015 14:04
HTTP resource JavaScript class for consuming REST API resources
import HttpResource from 'xhr';
var items = new HttpResource('/api/items');
items.query(function* (resume) {
yield items.create([
{name: 'Item #1'},
{name: 'Item #2'},
{name: 'Item #3'}
@roman01la
roman01la / nginx.conf
Last active May 18, 2019 07:00
Node.js Express Nginx
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:3000;
}
location ~ ^/(images/|scripts/|styles/|robots.txt|humans.txt|favicon.ico) {
root /your/app/public/folder;