Skip to content

Instantly share code, notes, and snippets.

View pavelnikolov's full-sized avatar
🌴
On vacation

Pavel Nikolov pavelnikolov

🌴
On vacation
View GitHub Profile
@pavelnikolov
pavelnikolov / rAF.js
Created December 9, 2012 23:05 — forked from re1ro/rAF.js
requestAnimationFrame polyfill
// requestAnimationFrame polyfill by @rma4ok
!function (window) {
var
equestAnimationFrame = 'equestAnimationFrame',
requestAnimationFrame = 'r' + equestAnimationFrame,
ancelAnimationFrame = 'ancelAnimationFrame',
cancelAnimationFrame = 'c' + ancelAnimationFrame,
expectedTime = 0,
require 'test_helper'
class RemoteNetaxeptTest < Test::Unit::TestCase
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
def setup
@gateway = NetaxeptGateway.new(fixtures(:netaxept))
@amount = 100
@credit_card = credit_card('4925000000000004')
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
var crypto = require("crypto")
, util = require("util")
, express = require("express");
var s3 = {
access_key_id: "<access_key>"
, secret_key: "<your_secret_key>"
, bucket: "<your_bucket>"
, acl: "public-read"
, https: "false"
@pavelnikolov
pavelnikolov / index.html
Created February 7, 2016 12:45 — forked from anonymous/index.html
JS Bin React + Redux todo app // source http://jsbin.com/qejizi
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="React + Redux todo app">
<script src="http://fb.me/react-0.14.3.js"></script>
<script src="http://fb.me/react-dom-0.14.3.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/redux/3.2.1/redux.js"></script>
<script src="https://wzrd.in/standalone/expect@latest"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<meta charset="utf-8">
@pavelnikolov
pavelnikolov / index.html
Created February 8, 2016 13:27 — forked from anonymous/index.html
JS Bin React + Redux todo app // source http://jsbin.com/qejizi
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="React + Redux todo app">
<script src="http://fb.me/react-with-addons-0.14.3.js"></script>
<script src="http://fb.me/react-dom-0.14.3.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/redux/3.2.1/redux.js"></script>
<script src="https://wzrd.in/standalone/expect@latest"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<meta charset="utf-8">
@pavelnikolov
pavelnikolov / fix-wordpress-permissions.sh
Created March 30, 2016 03:38 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@pavelnikolov
pavelnikolov / webtest.sh
Created July 18, 2016 00:38 — forked from technovangelist/webtest.sh
ZSH script to visit a page over and over again with random seconds between visits
#!/bin/zsh
# use webtest.sh <url to visit>
zmodload -i zsh/mathfunc
for i in {1..1000}
do
sleep $(( rand48()*2 ))
curl $1
done
dash_id=xxxx
api_key=xxx
app_key=xxx
# 1. export
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json
# 2. edit dash.json
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level