Skip to content

Instantly share code, notes, and snippets.

View highruned's full-sized avatar
💭
Forging...

HighRuned highruned

💭
Forging...
View GitHub Profile
@highruned
highruned / NavItem.js
Created February 2, 2015 00:16
Exploring how we can separate React.js presentation and logic
var Navbar = React.createClass({
getInitialState() {
return {
view: 'fullscreen',
top: 100,
left: 0
};
}
dust.helpers["tap"] = function(input, chunk, context) {
// return given input if there is no dust reference to resolve
// dust compiles a string/reference such as {foo} to a function
if (typeof input !== "function") {
return input;
}
var dustBodyOutput = '',
@highruned
highruned / script.js
Created May 4, 2014 15:14
ImTranslator TTS Spidermonkey Script
// ==UserScript==
// @name Japanese Text-To-Speech
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://www.memrise.com/course/*/*/edit/
// @copyright 2012+, You
// ==/UserScript==
unsafeWindow.injectTTS = function(ttsURL) {
@highruned
highruned / server.js
Created May 4, 2014 15:13
ImTranslator TTS Server
var connect = require('connect');
var http = require('http');
var exec = require('child_process').exec;
var url = require('url');
var app = connect()
.use(function(req, res) {
var queryData = url.parse(req.url, true).query;
var callback = queryData.callback;
@highruned
highruned / gist:9553730
Created March 14, 2014 18:26
Sub-konfs
'header': {>"konf/_header.include"/},
'footer': {>"konf/_footer.include"/},
'search': {>"konf/_search.include"/},
'primarySidebar': {>"konf/_search.include"/},
'content': function(context) {
return context.choose(
{>"konf/home.include"/},
{>"konf/brand.include"/},
{>"konf/searchResults.include"/}
@highruned
highruned / reflow.js
Created January 28, 2014 18:21
Reflow Layout
function reflowLayout() {
// Add this arbitrary margin-bottom to force a reflow
$('html').css('zoom', 1.001);
// We need the timeout for this zoom hack to work on all devices
setTimeout(function() {
$('html').css('zoom', 1);
}, 100);
}
@highruned
highruned / networth.html
Created May 22, 2013 03:25
Dashboard for net worth + current TODO list. Keeps you motivated? Currently over invested in ASICMINER, lol.
<html>
<body>
<div style="text-align: center">
<br />
<br />
<img id="am_value" src="" style="width: 700px; " />
<br />
<textarea id="todo" rows="20" cols="120"></textarea>
</div>
<script>
@highruned
highruned / speedtrain.sh
Last active December 15, 2015 21:29
speedtrain.sh
#!/bin/bash
#:Title : Speedtrain on Rails
#:Date :
#:Author : Obi Akubue, Eric Muyser
#:Version : 1.0
#:Description: This script installs Ruby on Rails on Ubuntu 12.04 with the option to install Apache and Phusion Passenger. (It creates a test rails app)
#Usage Option 1: To Install Rails (Ruby + Rubygems) + Sqlite. Simply run the script by typing ./speedtrain
#Usage Option 2: To Install Rails (Ruby + Rubygems) + Sqlite + MySQL + Apache + Passenger. Run script by typing ./speedtrain -p
<?php
$Phpr_InitOnly = true;
require_once('boot.php');
$cache = Core_CacheBase::create();
// change vars here
$debug = 1; // set to 1 if you wish to see execution time and cache actions
@highruned
highruned / gist:5243367
Last active December 15, 2015 10:09
Re-initialize LS datepicker madness
jQuery(function($) {
$('#FoxyGift_Configuration_foxygift_flexible_validity_date').change(function() {
if ($(this).is(':checked')) {
$('#form_field_foxygift_valid_daysFoxyGift_Configuration').addClass('hidden');
$('#form_field_foxygift_valid_untilFoxyGift_Configuration').removeClass('hidden');
}
else {
$('#form_field_foxygift_valid_daysFoxyGift_Configuration').removeClass('hidden');
$('#form_field_foxygift_valid_untilFoxyGift_Configuration').addClass('hidden');
}