This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <math.h> | |
#include <stack> | |
#include <iomanip> | |
#include <stdio.h> | |
using namespace std; | |
typedef unsigned long long llu; | |
int main(){ | |
// freopen("in.txt","r",stdin); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VECTOR | |
#include <math.h> | |
#include <vector> | |
#include <stdio.h> | |
using namespace std; | |
int main(){ | |
double x; | |
vector<double> xs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./manage.py shell | |
from django.contrib.auth.hashers import make_password, HASHERS | |
make_password('test') | |
'pbkdf2_sha256$10000$vkRy7QauoLLj$ry+3xm3YX+YrSXbri8s3EcXDIrx5ceM+xQjtpLdw2oE=' | |
make_password('test', 'abc') | |
'pbkdf2_sha256$10000$abc$MqJS5OAgSmf9SD9mfoY8fgLo8sSKmEcef0AjjMp1Q7w=' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sass-convert --from css --to scss vendor/jquery-ui/css/jquery-ui.css > styles/scss/vendor/_jquery-ui.scss |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var success = function(){ | |
console.log(this.responseText); | |
if(typeof callback === 'function') | |
callback(); | |
}; | |
var error = function(){ | |
console.log('=>error'); | |
}; | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", "http://ksapirest.herokuapp.com/v1/sessiontvs/43037", true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app_server_djangoapp { | |
server localhost:8002 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name www.karaokesmart.co; | |
#server_name ec2-22-214-31-98.us-west-2.compute.amazonaws.com; | |
location ~ ^/(lgproduccion|prueba)/? { | |
proxy_set_header HOST www.karaokesmart.com.mx; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
LOGFILE=/usr/local/virtualenvs/ks_env/ks.webapp2/kswebapp2.log | |
ERRORFILE=/usr/local/virtualenvs/ks_env/ks.webapp2/error.log | |
LOGDIR=$(dirname $LOGFILE) | |
NUM_WORKERS=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
var samples = []; | |
for( var i=0; i<1000; i++){ samples[i] = getRandomInt(-128,127);} | |
var floats = new Float32Array(samples.length); | |
samples.forEach(function( sample, i ) { | |
floats[i] = sample < 0 ? sample / 0x80 : sample / 0x7F; | |
}); | |
var ac = new webkitAudioContext() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase | |
from django.contrib.auth.models import User | |
from payments.models import Customer | |
# To allow test setup run only one time these workaround can be used | |
class CustomerModelTest(TestCase): | |
@classmethod | |
def setUpClass(cls): | |
cls.user = User.objects.create_user(username="[email protected]", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bacon = require('baconjs') | |
Imm = require('immutable') | |
React = require('react') | |
window.Actions = | |
changeFirstName: new Bacon.Bus() | |
changeLastName: new Bacon.Bus() | |
changeCountry: new Bacon.Bus() | |
addCountryBird: new Bacon.Bus() | |
addFriend: new Bacon.Bus() |
OlderNewer