Skip to content

Instantly share code, notes, and snippets.

View Teino1978-Corp's full-sized avatar

Teino Boswell Teino1978-Corp

  • Ocho Rios, Jamaica
View GitHub Profile
#include <utility>
void sort(int *tab, int N){
bool sorted;
do {
sorted = true;
for(int i = 0; i < N - 1; ++i) {
if(tab[i] > tab[i+1]) {
std::swap(tab[i], tab[i+1]);
sorted = false;
}
@Teino1978-Corp
Teino1978-Corp / slasher.js
Created November 19, 2015 22:42
Return the remaining elements of an array after chopping off n elements from the head. The head meaning the beginning of the array, or the zeroth index
// Bonfire: Slasher Flick
// Author: @praxitelis
// Challenge: http://www.freecodecamp.com/challenges/bonfire-slasher-flick?solution=function%20slasher(arr%2C%20howMany)%20%7B%0A%20%20%20%20%2F%2F%20it%20doesn%27t%20always%20pay%20to%20be%20first%0A%20%20%20%20%0A%20%20%20%20%22use%20strict%22%3B%0A%0A%20%20%20%20var%20array%3B%0A%20%20%20%20%0A%20%20%20%20array%20%3D%20arr.slice(howMany%2C%20arr.length)%3B%0A%0A%20%20%20%20return%20array%3B%0A%7D%0A%0Aslasher(%5B1%2C%202%2C%203%5D%2C%202)%3B%0A
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function slasher(arr, howMany) {
// it doesn't always pay to be first
"use strict";
@Teino1978-Corp
Teino1978-Corp / post.rb
Created November 19, 2015 19:05
Category slugify plugin for Jekyll 3.0.0: This plugin will slugify the categories listed in the YML frontmatter. Categories with multiple words will have the spaces replaced with dashes. Put this file in the _plugins directory.
module Jekyll
class Document
#Updated for Jekyll 3.0.0
# override post method in order to return categories names as slug
# instead of strings
#
# An url for a post with category "category with space" will be in
@Teino1978-Corp
Teino1978-Corp / RabbitStew.js
Created November 19, 2015 14:04
RabbitStew.createConsumers example.
// function prototype to create queue and consumers with one call
RabbitStew.createConsumers(exchange, options, consumers);
// example usage
var exchange = RabbitStew.exchange(process.env.RABBIT_URL, 'test.exchange');
var queue = createConsumers(exchange, { name: 'test.queue', exclusive: false }, {
'logs.error': function (data) {
...
return Promise.resolve('ack');
@Teino1978-Corp
Teino1978-Corp / dbram_helix
Created November 19, 2015 13:36
Models for Helix
Advisors
has_many :licenses
has_many :contacts
has_many :contact_records, foreign_key => :owner_id
has_many :clients
has_many :affiliates
has_one :office
belongs_to :manager
@Teino1978-Corp
Teino1978-Corp / C4WorkSpace.m
Created November 19, 2015 13:13
Double Helix + Single Helix
//
// C4WorkSpace.m
//
// Created by Travis Kirton
//
#import "C4WorkSpace.h"
@implementation C4WorkSpace {
NSMutableArray *skyImages, *tableImagesRight, *tableImagesLeft;
@Teino1978-Corp
Teino1978-Corp / custom_radio.jade
Created November 19, 2015 12:57
Custom components: Radio button
.radio
input.radio-input(type='radio' name='ZIP99 FM - https://www.facebook.com/photo.php?fbid=10207850698527916&set=p.10207850698527916&type=3&theater')
.radio-container
.radio-fill
@Teino1978-Corp
Teino1978-Corp / gistfile1.txt
Created November 19, 2015 12:40
Use JavaScript to determine the screen size correctly
/*
Drop this right after your document.ready statement and you can accurately use screenWidth and screenHeight to do dynamic calculations
*/
screenWidth = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
screenHeight = window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;
<?php
header('Content-Type: text/html; charset=utf-8');
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'OneDriveClient.php';
$client = new OneDriveClient('EwBYAq1DBAAUGCCXc8wU/zFu9QnLdZXy+YnElFkAAfMuYeVr71bpeGhrjEkpQerilJPcmh5WClc92WvF86QcVJ09c00C00bBiJJx/fqpt2yJvsDglNWfdMLIDpTR61kwq4CEcoDvlI1uyksJg9u62mSghrxEaJoEGyknY1s3LJOhzkZrycStJZ7uKsx7qd/2DU/mcFaGkEcH0ggGbwuEubeL8N4ZRJ0+I03M50uy722upZ1fGFjDikvJ//YqZYUHAI7HcPE9JSIhproutL/cpin61JvkEEI8yA0GC2ekqgBDasSpJi6f9nq8IQoGxpDubZwxiaW188YXj2r63Ktgfs/s5TYY8b7g+6OnpMeg0E678Y1W6PGG/g1a4N1T5rADZgAACGmwAtyU3SluKAFloXbZtKXG513XWnGB2LOnJEI2tCzi6Mq6WUJSZT0sLPGubkmxYGNHzpMXFUCblUt8EHO/RRCj+OWxqyd/d5h9ZAwkBhxnsvp9nixpdUDi2Y20TK6O+H7CxPsFqDLqSOV8MbrFXtkGBpDrVkiUcw+MOX5fDC3ixQzLts0GemJMYr/mT4qsTVQE67iR9IoGAOpatdMKXNKBLyFlv7OVTA9Q09hAb9hX1Ye0flepM/p/2827XCYdglO7d/Sk3RNFrruSLRwmixkpVKo1jr9q646hr83hMhXH7D9H5RsMS4FPT4QcoNVZ0TJolKJ8D1hGARqq+7W4rEhRMYSyGyAf8cnsGD2miNilF95z4zU2TQgBzs37/94sL/e7zmQGWQca9sSmBADHufdS+VAB');
$result = $client->download_file('faila.txt');
var_dump($
class abc {
public static void main(String[] args) {
DomainObject subDomain = null;
Map<DomainField, String> d = null;
subDomain.add(DomainField.ZIP, d.get(DomainField.ZIP));
}
private static interface SomeOtherInterface { }
private static class FieldValueAssociation { }