Skip to content

Instantly share code, notes, and snippets.

View elebetsamer's full-sized avatar

Eric Lebetsamer elebetsamer

  • Electronic Arts
  • Bay Area, CA
View GitHub Profile
@elebetsamer
elebetsamer / modal-demo.tsx
Created May 21, 2018 16:26
Stencil Modal Component
import { Component, Element, Prop, Listen, Method, State } from '@stencil/core';
@Component({
tag: 'st-demo-modal',
styleUrl: 'st-demo-modal.scss'
})
export class DemoModal {
modal: HTMLStModalElement;
@Element()
@elebetsamer
elebetsamer / yahoo-block-news.user.js
Last active March 31, 2018 05:38
User Script - Remove yahoo.com news articles
// ==UserScript==
// @name Remove yahoo.com news articles
// @namespace https://github.com/elebetsamer
// @version 0.3
// @description Remove unwanted news articles from the yahoo.com home page. You can set categories to block or sources.
// @author elebetsamer
// @match http*://*.yahoo.com
// @icon https://mbp.yimg.com/sy/rz/l/favicon.ico
// @grant none
// ==/UserScript==
@elebetsamer
elebetsamer / st-generate.js
Last active July 26, 2018 15:05 — forked from mlynch/generate.js
Stencil component generator
/*
To setup, place in scripts/st-generate.js and add
"st:generate": "node scripts/st-generate.js"
To your npm scripts.
To generate a component in src/components/ run
npm run st:generate component my-component
@elebetsamer
elebetsamer / .editorconfig
Last active October 14, 2015 09:34
Default project configuration files
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
@elebetsamer
elebetsamer / js-crc32
Created July 18, 2014 05:03
A javascript CRC32. Original code from http://stackoverflow.com/questions/18638900/javascript-crc32 (and http://jsperf.com/js-crc32). Does not support UTF8
var makeCRCTable = function(){
var c;
var crcTable = [];
for(var n =0; n < 256; n++){
c = n;
for(var k =0; k < 8; k++){
c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
}
crcTable[n] = c;
}
@elebetsamer
elebetsamer / gist:7d6afc87fcec795442d8
Created July 11, 2014 03:28
Clone Grunt-Init templates (Windows)
git clone https://github.com/gruntjs/grunt-init-jquery.git %USERPROFILE%\.grunt-init\jquery
git clone https://github.com/gruntjs/grunt-init-commonjs.git %USERPROFILE%\.grunt-init\commonjs
git clone https://github.com/gruntjs/grunt-init-gruntfile.git %USERPROFILE%\.grunt-init\gruntfile
git clone https://github.com/gruntjs/grunt-init-gruntplugin.git %USERPROFILE%\.grunt-init\gruntplugin
git clone https://github.com/gruntjs/grunt-init-node.git %USERPROFILE%\.grunt-init\node
var topmenuClass = '.ms-core-listMenu-horizontalBox';
$(topmenuClass + ' .ms-hidden').html('');
$(topmenuClass + ' ul li a span').not('[class="ms-navedit-editLinksIconWrapper"]').replaceWith(function () {
return $(this).html();
});
$(topmenuClass + ' ul li a span').not('[class="ms-navedit-editLinksIconWrapper"]').replaceWith(function () {
return $(this).html();
});
/*
* Original Sample: http://craftycodeblog.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/
*/
public class HomeController : Controller
{
public ActionResult Index()
{
string MyModelData = "";
@elebetsamer
elebetsamer / Unity-ViewOrthographicCameraBounds
Last active May 5, 2021 19:27
View the bounds of an orthographic camera in Unity even if it isn't selected.
void OnDrawGizmos()
{
float verticalHeightSeen = Camera.main.orthographicSize * 2.0f;
float verticalWidthSeen = verticalHeightSeen * Camera.main.aspect;
Gizmos.color = Color.cyan;
Gizmos.DrawWireCube(transform.position, new Vector3(verticalWidthSeen, verticalHeightSeen, 0));
}
@elebetsamer
elebetsamer / SharePoint2013-HideFollowButton.css
Last active April 26, 2018 00:44
A way to hide the follow button in the SharePoint 2013 Ribbon.
#site_follow_button {
display: none !important;
}