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 myLoop() { | |
var interval = setInterval(function() { | |
$.post('/mojis', { 'moji[content]': 'hi' }); | |
/*$.post('/users', { | |
'user[username]': Date(), | |
'user[password]': 'sillypass', | |
'user[password_confirmation]': 'sillypass' | |
});*/ | |
}, 500); | |
} |
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 d() { | |
return Math.random() >= 0.5; | |
} | |
function myLoop() { | |
var interval = setInterval(function() { | |
var str = '`~=~`~=+=~`~``~=~`~-+==~`~-_-~`:'; | |
if ($('body')) { | |
var str = $('body').text(); | |
} |
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
-- This function is a generalized way to upsert multiple optional fields of a | |
-- table based on the hstore param "my_params" | |
create or replace function upsert_table_vararg( | |
my_table_name text, | |
my_id_col_name text, | |
my_params hstore | |
) | |
returns void as $$ | |
declare vkey text; | |
declare vquery text; |
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
require 'spec_helper' | |
describe Users::OauthCallbacksController, "handle facebook authentication callback" do | |
describe "#annonymous user" do | |
context "when facebook email doesn't exist in the system" do | |
before(:each) do | |
stub_env_for_omniauth | |
get :facebook |
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
/script exec -perm Irssi::signal_add('message public', sub { $_[0]->window_find_name($_[4])->set_active }) |
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
const shuffleArray = function(array) { | |
const a = array.slice(); | |
for (let i = a.length - 1; i > 0; i--) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[a[i], a[j]] = [a[j], a[i]]; | |
} | |
return a; | |
}; |
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
/** | |
* A linear interpolator for hex colors. | |
* | |
* Based on: | |
* https://gist.github.com/rosszurowski/67f04465c424a9bc0dae | |
* | |
* @param {Number} a (hex color start val) | |
* @param {Number} b (hex color end val) | |
* @param {Number} amount (the amount to fade from a to b) | |
* |
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
let q = orbitGroup.quaternion.clone(); | |
const rotation = new THREE.Quaternion(); | |
rotation.setFromAxisAngle(new THREE.Vector3(1, 0, 0), -Math.PI / 2); | |
q.multiply(rotation); | |
orbitPlane.normal.set(0, 0, 1).applyQuaternion(q); |
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
static void DrawSurfaceToScreen() | |
{ | |
int n = _num_dirty_rects; | |
if (n == 0) return; | |
_num_dirty_rects = 0; | |
if (n > MAX_DIRTY_RECTS) { | |
if (_sdl_screen != _sdl_realscreen) { | |
SDL_CALL SDL_BlitSurface(_sdl_screen, NULL, _sdl_realscreen, NULL); | |
} |
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
static void DrawSurfaceToScreen() | |
{ | |
int n = _num_dirty_rects; | |
if (n == 0) return; | |
_num_dirty_rects = 0; | |
if (n > MAX_DIRTY_RECTS) { | |
SDL_CALL SDL_UpdateTexture( | |
_sdl_texture, NULL, _sdl_surface->pixels, _sdl_surface->pitch); |
OlderNewer