Skip to content

Instantly share code, notes, and snippets.

View 3en's full-sized avatar

Ben Reyes 3en

View GitHub Profile
@3en
3en / gist:29c1fcca222ae435c84e
Created December 9, 2014 21:29
zendeskbreyes Keybase
### Keybase proof
I hereby claim:
* I am 3en on github.
* I am zendeskbreyes (https://keybase.io/zendeskbreyes) on keybase.
* I have a public key whose fingerprint is A275 8AC8 8980 E49C DEE3 A9FD 1A97 2510 45A1 D97A
To claim this, I am signing this object:
### Keybase proof
I hereby claim:
* I am 3en on github.
* I am 3en (https://keybase.io/3en) on keybase.
* I have a public key whose fingerprint is C882 DE09 1AF4 F900 41F8 FC5F 6C60 B6E3 5C7F 27A5
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am 3en on github.
  • I am 3en (https://keybase.io/3en) on keybase.
  • I have a public key whose fingerprint is 6C51 AC8C 14C5 D504 1AC2 772D 8EBD FC12 A436 EB87

To claim this, I am signing this object:

</style>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" charset="UTF-8"></script>
<script type="text/javascript">
setTimeout(function(){
var email_confirmation = '<div style="margin-top: 12px;"><label for="email_confirmation">Email confirmation:<abbr title="Required">*</abbr></label><input id="email_confirmation" name="email_confirmation" required="required" title="Please fill out this field." type="email"><div class="validation error" id="conformation_validation" style="display: block;"></div></div>';
$(".two_across").append(email_confirmation);
$("#ticket_submission form").submit(function(e){
@3en
3en / gist:4225690
Created December 6, 2012 16:15
Zendesk - Classic - Incident Tagging
// Flag Incident Type
// Author: Ben Matthew Reyes - EMEA - breyes@zendesk.com
// Written: December 2012
// Usable by any customers using the classic interface.
// Screencast - http://www.screenr.com/8Cx7
// --- Install Instructions ---
// Add as a global javascript widget, visible to users that are logged in and are agents.
@3en
3en / gist:3020759
Created June 29, 2012 21:26
Domain
#!/usr/bin/env python
# Name generating code
# Copyright (c) 2010 Ninite.com
#
# Released into the public domain - enjoy!
#
# Story at http://blog.ninite.com/post/620277259/how-ninite-was-named-by-a-computer-program
from datetime import datetime, date
@3en
3en / split_string_by_words
Created October 20, 2011 10:32
Splits a PHP string by word count
/** splitByWords
*
* Splits a string by $maxLength of words
* Based off the code: http://stackoverflow.com/questions/6604016/word-count-cut-off/6604052#6604052
*
*/
public static function splitByWords($text, $splitLength = 200)
{
// explode the text into an array of words
@3en
3en / fizzbuzz.rb
Created September 3, 2011 08:23
FizzBuzz
# http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
# Write a program that prints the numbers from 1 to 100.
# But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz".
# For numbers which are multiples of both three and five print "FizzBuzz".
(1..100).each do |i|
if i % 3 == 0 && i % 5 == 0
puts "FizzBuzz"
@3en
3en / autobackupmongo.rb
Created August 18, 2011 18:06 — forked from lajunta/autobackupmongo.rb
auto backup mongo (ruby version and very concise)
# Instead of backing up on set days this will check the time differences
# between the last backup and the time the script running.
# Useful if you're backing up irregularly on a laptop
#!/usr/local/ruby/bin/ruby -w
require 'time'
@3en
3en / convert decimal to hex string
Created August 6, 2011 14:31
Convert array of hex decimal representation (ObjectId.data) to a hex string
# Converts an array of hex decimal representation (ObjectId.data) to a hex string.
# e.g [78, 26, 131, 172, 159, 165, 6, 0, 1, 0, 0, 125] > '4e1a83ac9fa506000100007d'
# convert_to_hex_string([78, 26, 131, 172, 159, 165, 6, 0, 1, 0, 0, 125])
def convert_to_hex_string(dec_array)
dec_array.map { |n| "%02x" % n }.join
end