Skip to content

Instantly share code, notes, and snippets.

View bumble-bee-chuna's full-sized avatar

Bee bumble-bee-chuna

  • Anchorage, Alaska
View GitHub Profile
https://<dc>.api.mailchimp.com/2.0/lists/subscribe.json?apikey=<my_api_key>&id=<my_list_id>&email[email][email protected]&merge_vars[FNAME]=John&merge_vars[LNAME]=Doe&double_optin=false&send_welcome=false
Where <dc> should be replaced with the portion after the dash in your API Key. e.g. "us1", "us2", "uk1", etc.
http://stackoverflow.com/questions/19671676/javascript-mailchimp-api-subscribe
CREATE ROLE mystore LOGIN PASSWORD 'mystore' NOINHERIT CREATEDB;
Errors you will get in rails if you don't have the username available:
ActiveRecord::NoDatabaseError: FATAL: role does not exist rails
friggin start and stop the damn thing:
$ brew services list
$ brew services restart postgresql
@bumble-bee-chuna
bumble-bee-chuna / sendRawEth.c
Created February 6, 2016 02:38 — forked from austinmarton/sendRawEth.c
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapActivity" >
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.beckah.helloworld">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
package com.example.beckah.helloworld;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
@bumble-bee-chuna
bumble-bee-chuna / Time Complexity question
Last active November 9, 2015 23:16
How does the powerlaw ( aN^b ) relate to a log-log run time ( lg(T(N)) = b lg N + c )?
The following data is given for the run time of a program:
https://d2gne97vdumgn3.cloudfront.net/api/file/XF3gUiIRRh2321KcJHbO
And then is graphed in a log-log scale graph and through compressing it for a log-log scale graph,
has a slope of 3.
https://d2gne97vdumgn3.cloudfront.net/api/file/n3GlkRKWSg6V1EyKAzOj
The formula for the line can then be described as:
log(T(N)) = b lg N + c
@bumble-bee-chuna
bumble-bee-chuna / gist:a456f9e5b0332075f55b
Created July 21, 2015 13:16
Error thrown setting reader scope to "step"
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storeCampaignInfoTasklet' defined in class path resource [config/batch/marketing-campaign-spring-object-config.xml]: Cannot resolve reference to bean 'campaignInfoFileReader' while setting bean property 'delegateReader'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'campaignInfoFileReader': Scope 'step' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No context holder available for step scope
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:326)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
at org.springframework.beans.factory.support.Abs
<bean id="stgMktngCampaignFileReader" class="org.springframework.batch.item.file.FlatFileItemReader"
abstract="true" lazy-init="true" scope="step">
<property name="resource" value="#{jobParameter[input.file]}" />
<property name="linesToSkip" value="1" />
</bean>
<bean id="campaignInfoFileReader" parent="stgMktngCampaignFileReader">
<!-- LINE MAPPER -->
<property name="lineMapper">
<bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper">
@bumble-bee-chuna
bumble-bee-chuna / gist:65b780537b60750b1b05
Created July 16, 2015 15:03
spring integration error
Error creating bean with name 'storeCampaignInfoTasklet' defined in class path resource [config/batch/marketing-campaign-spring-object-config.xml]: Cannot resolve reference to bean 'campaignInfoFileReader' while setting bean property 'delegateReader'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'campaignInfoFileReader': Scope 'step' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No context holder available for step scope