Skip to content

Instantly share code, notes, and snippets.

sass-convert --from css --to scss vendor/jquery-ui/css/jquery-ui.css > styles/scss/vendor/_jquery-ui.scss
@steve-chavez
steve-chavez / ajaxxhr.js
Last active August 29, 2015 14:04
Make ajax requeste with no library
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);
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;
#!/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
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()
@steve-chavez
steve-chavez / test_one_setup_django.py
Last active August 29, 2015 14:05
Django one time setup in test
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="test@est.com",
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()
package org.yourcompany.test;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import javax.sql.DataSource;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@steve-chavez
steve-chavez / nginx
Created May 26, 2015 22:36
Nginx config
upstream java_app{
server 127.0.0.1:8080;
}
server {
listen 80;
server_name 172.168.201.30;
access_log /home/eduardo/nginx-access.log;
error_log /home/eduardo/nginx-error.log;