Skip to content

Instantly share code, notes, and snippets.

View nelsonic's full-sized avatar
💭
Let's Build a Better World Together!☀️

Nelson nelsonic

💭
Let's Build a Better World Together!☀️
View GitHub Profile
@nelsonic
nelsonic / css-toggle
Created February 3, 2014 15:41
CSS ONLY Toggle Button with Valid HTML
<div>
<input type="checkbox" id="switch1" name="switch1" class="switch" />
<label for="switch1">First switch</label>
</div>
<style> /* put this in buttons.scss */
input.switch:empty
{
margin-left: -999px;
@nelsonic
nelsonic / button-in-link.html
Created December 16, 2013 13:17
Non Valid HTML Markup (Button within a Link)
@nelsonic
nelsonic / styled-select.html
Created December 6, 2013 15:29
Styled Select Box
<select class="styled-select">
<option class="red">Cooperation </option>
<option class="blue">Competence </option>
</select>
</p>
<style>
.styled-select {
font-size: 1.4em;
color: #DCDCDC;
@nelsonic
nelsonic / Fake-image-upload-button
Created December 4, 2013 15:23
Changing Text on File Upload Button (Hack)
<!-- Fake Upload Button assumes we have JQUery -->
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<!-- Font awesome is optional -->
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<!-- copy these over to profile.scss -->
<style>
/* This is a workaround to style the image upload button
* We googled it extensively and the best "solution" we found
* was: http://www.quirksmode.org/dom/inputfile.html
* not ideal but it works
@nelsonic
nelsonic / mario-resize.html
Created October 26, 2013 09:10
Pet Rock HTML & JavaScript (helping a friend learn JavaScript...)
<!DOCTYPE html>
<html>
<head>
<title>
iRock - The Virtual Pet Rock
</title>
<script type="text/javascript">
var userName;
/**
* Copyright 2012 Google Inc. All Rights Reserved.
*
* 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
<apex:page standardController="Opportunity" extensions="jquery_minihack">
<style>
#myTitle {
font-size:20px;
text-align: center;
}
.element {
width:50%;
@nelsonic
nelsonic / hello.coffee
Created April 19, 2013 13:59
A Basic Hello World NodeJS script in CoffeeScript. This can be a two or three line script. but i've done it this way to explain the components.
http = require 'http' # Require the HTTP Core NodeJS Module (notice the lack of brackets)
port = process.env.PORT or 4000 # The TCP port you want to "listen" on (see line #6) allows the system (e.g. Heroku to set it or uses 4000 on local machine)
http.createServer (req, res) -> # Creates a basic Web Server and gives you the REQuest and RESponse objects to the function
res.writeHead 200 # Write the HTTP Status Code "200" ("All OK") in the RESponse to the client (browser)
res.end 'Hello World!' # End the RESponse with the message 'Hello World'
.listen port # the dot before the word listen means "Chain" to the createServer and listen on the port
console.log "Visit: http://localhost:#{port}" # console.log allows you to write a "Note-to-self" on the command line.
### if any of the above is unclear, Google it! (or msg me for a personal Tutorial: https://twitter.com/nelsonic) ###
@nelsonic
nelsonic / HTTPHelper.java
Created April 18, 2013 03:43
This is what Nimil had.
/**
* @author Nimil Christopher
* @date 12 April 2013
* @description This class has the Rest Callouts to publish an application to
* the CDN
*/
public with sharing class HTTPHelper {
public static Http http;
@nelsonic
nelsonic / sort.html
Created April 16, 2013 16:47
ASCII Ascending Order Sort Sort in HTML/JavaScript
<html>
<h1>Sort</h1>
<!-- enable the Chrome Developer Console to see Results -->
<script>
str = 'X,a,A,C,D,F,1,c,4,3'
data = str.split(',')
console.dir(data)
counter = 0;
limit = data.length;
end = limit-1;