Skip to content

Instantly share code, notes, and snippets.

View imajes's full-sized avatar

James Cox imajes

View GitHub Profile
%s=0x%llx
KMGTBb
"%@" doesn't exist in entry "%@"
"%@" is not a valid data criterion
"%@" of entry "%@" is class %@ while expecting BOOL<NSNumber>
"%@" of entry "%@" is class %@ while expecting NSData
"%@" of entry "%@" is class %@ while expecting NSNumber
"%@" query failed in internal service!
"%@" query failed!
"%@" query is not successfully from internal service
-- new table bloat query
-- still needs work; is often off by +/- 20%
WITH constants AS (
-- define some constants for sizes of things
-- for reference down the query and easy maintenance
SELECT current_setting('block_size')::numeric AS bs, 23 AS hdr, 8 AS ma
),
no_stats AS (
-- screen out table who have attributes
-- which dont have stats, such as JSON
## requires the 'terminal-table' gem
RSpec.configure do |config|
config.include FactoryBot::Syntax::Methods
config.before(:suite) do
# prep factory_run tracking
FactoryBot::Analytics.track_factories
end
function XHConn()
{
var xmlhttp, bComplete = false;
try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
catch (e) { try { xmlhttp = new XMLHttpRequest(); }
catch (e) { xmlhttp = false; }}}
if (!xmlhttp) return null;
this.connect = function(sURL, sMethod, sVars, fnDone)
{
version: '3'
networks:
int-service-proxy:
external: true
services:
watchtower:
container_name: watchtower
restart: unless-stopped
using UnityEngine;
using System.Collections;
using System.Web;
public class GoogleMap : MonoBehaviour
{
IEnumerator _Refresh ()
{
var url = "http://maps.googleapis.com/maps/api/staticmap";
@imajes
imajes / new_relic.fluid.user.js
Created October 4, 2011 01:31
Fluid/ New Relic user script
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
var status = document.getElementsByClassName("app_status_info")[1]
var thruput = status.children[0].innerText;
window.fluid.dockBadge = thruput;
}
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
@imajes
imajes / gist:4314471
Created December 17, 2012 00:10
why i like awesome_print etc
(main)> magic = App.delegate.instance_variable_get('@magic_controller')
=> #<MagicController:0xc072f00>
(main)> ap magic.methods
[
[ 0] !() MagicController (NSObject)
[ 1] !=:(arg1) MagicController (NSObject)
[ 2] !~:(arg1) MagicController (NSObject)
[ 3] <<:(arg1) MagicController (UIViewController)
[ 4] <=>:(arg1) MagicController (NSObject)
[ 5]