Skip to content

Instantly share code, notes, and snippets.

Avatar
😛

Matt Geczy

😛
  • United States
View GitHub Profile
View gist:2531171
<?php
class Curl
{
public $cookieJar = "";
public function __construct($cookieJarFile = 'cookies.txt') {
$this->cookieJar = $cookieJarFile;
}
View gist:2554421

Introduction

Luna will be an eComerce platform to sell video games to customers.

Project Objectives

  • Offer a multitude of video game retail options.
  • Categorize all products.
@Geczy
Geczy / sso_login_freshdesk.php
Created Dec 4, 2012
SSO Login for Freshdesk support portal - PHP Sample Code
View sso_login_freshdesk.php
function freshdesk_login_url($name, $email) {
$secret = '____Place your Single Sign On Shared Secret here_____';
$base = 'http://mycompany.freshdesk.me/';
return $base . "login/sso/?name=" . urlencode($name) . "&email=" . urlencode($email) . "&hash=" . hash('md5', $name . $email . $secret);
}
header("Location: " . freshdesk_login_url("John Doe", "username@thecompany.com") );
View gist:10f5b7a6aed5f59a2028
--<< 100% critical strike (not for items) >>
--===================--
-- LIBRARIES --
--===================--
require("libs.ScriptConfig")
function Set (list)
local set = {}
for _, l in ipairs(list) do set[l] = true end
View gist:58ade6af220699c4fa1b
function extract_common_words($string, $max_count = 10) {
$string = preg_replace('/ss+/i', '', $string); // replace whitespace
$string = preg_replace('/[^a-zA-Z -]/', '', $string); // only take alphabet characters, but keep the spaces and dashes too…
$string = strtolower($string); // make it lowercase
$matched = array();
$tok = strtok($string, " ");
while ($tok !== false) {
if ( !empty($tok) && !in_array(strtolower($tok), $this->stopWords) && strlen($tok) > 3 ) {
View gist:fc43b2053cc78ccecfdc
@echo
cd c:\program files (x86)\livestreamer
set /p stream=Type twitch name:
start /max "" "%ProgramFiles(x86)%\Internet Explorer\iexplore.exe" http://www.twitch.tv/%stream%/chat?popout=[7]
livestreamer.exe twitch.tv/%stream% source
@echo off
View gist:114f3618fb425442344b
var questionID;
$(function() {
/* $("#txt_name").keyup(function(){
alert($(this).val());
});*/
$(document).on('click', '.delete', deleteItem);
$("#addParent").on('click', addParent); //#add means select the thing which has id add. id is for singular things (only one thing may have id add)
$('#firstQuestion').on('click', function(e) {
var buttonClicked = $(this).data('findid');
View gist:5f9dd1350870e835c06e
var questionID;
function rebind() {
$('.addQuestion').on('click', function (e) {
$('#saveNewQuestion').data('findid', $(this));
$('#firstQuestionModal').modal('show');
})
}
View optimize.php
$urls = Repo::all();
$correctKeys = \DB::connection()->getSchemaBuilder()->getColumnListing("packages");
unset($correctKeys[0], $correctKeys[1]);
foreach ($urls as $repo) {
$text_filename = $repo->id . '.txt';
if (!Storage::exists($text_filename)) {
continue;