Skip to content

Instantly share code, notes, and snippets.

View verygreenboi's full-sized avatar
💻
Slamming keys!

Thompson Edolo verygreenboi

💻
Slamming keys!
View GitHub Profile
@verygreenboi
verygreenboi / artist.cfm
Created July 21, 2011 10:29 — forked from atuttle/artist.cfm
An example of writing REST web services in ColdFusion, without a framework. This code is provided as an example of a simple implementation, but should not be considered a best practice or something I am promoting. I use this in one of my presentations as
<!---
An example of writing REST web services in ColdFusion, without a framework (and why you should use one).
Provided as an example of a simple implementation, but should not be considered a best practice or something
I am promoting. Not thoroughly tested, not very maintainable, not even that reusable.
--->
<cfsetting enablecfoutputonly="true" showdebugoutput="false" />
<cffunction name="StructKeyRequire" output="false">
<cfargument name="s" type="struct" />
@verygreenboi
verygreenboi / gist:3060403
Created July 6, 2012 14:13 — forked from jonmarkgo/gist:2949583
Basic WiFly Setup
#include <SPI.h>
#include <WiFly.h>
char* ssid = "my$ssid$lol"; //enter your SSID here, replace all spaces with $ (ex. "my ssid lol" = "my$ssid$lol")
char* pass = "abc123"; //enter your wifi passphrase here
char* serverAddress = "1.2.3.4"; //enter the IP of your node.js server
int serverPort = 1337; //enter the port your node.js server is running on, by default it is 1337
WiFlyClient client;
<!-- http://benalman.com/projects/jquery-urlinternal-plugin/ -->
<script src='<?php bloginfo('template_directory'); ?>/js/jquery.ba-urlinternal.min.js'></script>
<!-- http://www.asual.com/jquery/address/ -->
<script src='<?php bloginfo('template_directory'); ?>/js/jquery.address-1.3.min.js'></script>
<script>
// Original JavaScript by Chris Coyier
// Updated October 2010 by Stewart Heckenberg & Chris Coyier
@verygreenboi
verygreenboi / countries.sql
Created November 15, 2012 20:14 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@verygreenboi
verygreenboi / index.html
Created November 23, 2012 17:51
A CodePen by Fabrice Weinberg. Facebook loading symbole pure CSS - I want to play with multiple background images and linear-gradients and tried to make the Facebook Loading Symbole (https://s-static.ak.facebook.com/rsrc.php/v2/yk/r/LOOn0JtHNzb.gif)
<div class="wrapper">
<h1>Facebook Loader in pure CSS</h1>
<div id="loader"></div>
<a href="https://s-static.ak.facebook.com/rsrc.php/v2/yk/r/LOOn0JtHNzb.gif">Original *.gif</a>
</div>
class CreateBase < ActiveRecord::Migration
def up
create_table :games do |t|
t.integer :home_team_id, :null => false
t.integer :away_team_id, :null => false
t.integer :score, :null => false
end
create_table :teams do |t|
t.string :team_name, :null => false
@verygreenboi
verygreenboi / splash.java
Created May 19, 2014 01:38
I'll you this later
package com.shashank.sharjahinternationalairport;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
public class Splash extends Activity{
MediaPlayer splashSound;
@Override
/*
* Copyright 2013 Evelio Tarazona Cáceres <evelio@evelio.info>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
@verygreenboi
verygreenboi / CountingFileRequestBody.java
Last active August 29, 2015 14:27 — forked from eduardb/CountingFileRequestBody.java
Uploading a file with a progress displayed using OkHttp
public class CountingFileRequestBody extends RequestBody {
private static final int SEGMENT_SIZE = 2048; // okio.Segment.SIZE
private final File file;
private final ProgressListener listener;
private final String contentType;
public CountingFileRequestBody(File file, String contentType, ProgressListener listener) {
this.file = file;