Skip to content

Instantly share code, notes, and snippets.

View benaneesh's full-sized avatar

Ben Aneesh benaneesh

View GitHub Profile
@benaneesh
benaneesh / media_server_docker_compose.yml
Created October 31, 2022 19:30
Media Server Docker Compose
version: "3.9"
######### IMPORTANT #############
# docker-compose-t2.yml is my main docker compose that runs on the same Proxmox host.
# You will find only a few apps in this web stack that hosts a few wordpress and non-wordpress sites.
# You can copy-paste services from one docker-compose file in this repo to another to add other apps.
########################### SYSTEM DESCRIPTION
# DOCKER-COMPOSE FOR WORDPRESS / WEB SERVER
# Digital Ocean: 1 vCPU, 2 GB RAM, and 50 GB NVME
@benaneesh
benaneesh / gist:32b7b2306966ed583877ed2aa80bcab4
Last active November 2, 2018 18:28 — forked from carolineschnapp/gist:5397337
Sample JavaScript file added with ScriptTag resource. This sample file is meant to teach best practices.Your app will load jQuery if it's not defined. Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7.
/* Sample JavaScript file added with ScriptTag resource.
This sample file is meant to teach best practices.
Your app will load jQuery if it's not defined.
Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7.
Your app does not change the definition of $ or jQuery outside the app.
Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2'
once the app is installed, even if the app uses jQuery 1.9.1:
jQuery.fn.jquery => "1.4.2"
$.fn.jquery -> "1.4.2"
*/
# Ian London 2016
# couldn't get anything I found to work... do it myself
# this downloads thumbnails from Google Images.
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import base64
import re
<apex:page standardController="LiveText__Conversation_Session__c"
extensions="LiveText.LiveTextChatController" >
<c:ScriptsComponent id="scmp" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<apex:pageMessages id="lt_pageMessages" />
<apex:stylesheet value="{!URLFOR($Resource.LiveText__Framework, 'framework/css/bootstrap.min.css')}" />
<apex:includeScript value="{!URLFOR($Resource.LiveText__Framework, 'framework/js/bootstrap.min.js')}" />
<apex:includeScript value="{!URLFOR($Resource.LiveText__LiveText, 'js/forcetk.js')}" />
<apex:includeScript value="/soap/ajax/36.0/connection.js" />
<apex:includeScript value="/support/console/36.0/integration.js" />
@benaneesh
benaneesh / The Technical Interview Cheat Sheet.md
Created April 3, 2017 17:02 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
import Foundation
import Alamofire
import SwiftyJSON
// MARK: - Request for Swift JSON
extension Request {
public static func SwiftyJSONResponseSerializer(options options: NSJSONReadingOptions = .AllowFragments)
-> ResponseSerializer<JSON, NSError> {
// Usual:
/**
This method prints the name of the user we want to great to and
returns the connected user.
- parameter user: The user we want to greet.
- returns: The user we talked to.
*/
// Possible:
/**
/* add */
let childController = MyViewController()
addChildViewController(childController)
childController.view.frame = view.frame // or any other frame
view.addSubview(childController.view)
childController.didMoveToParentViewController(self)
/* remove */
if let childController = childViewControllers.last {
childController.willMoveToParentViewController(nil)
class MyManager {
static let sharedInstance = MyManager()
private init() {} //This prevents others from using the default '()' initializer for this class.
}
public extension RangeReplaceableCollectionType where Index: Comparable {
public subscript (safe index: Index) -> Generator.Element? {
get {
guard indices ~= index else { return nil }
return self[index]
}
set {
guard indices ~= index else { return }
if let newValue = newValue {
self.removeAtIndex(index)