Skip to content

Instantly share code, notes, and snippets.

View gabeklein's full-sized avatar

Gabe Klein gabeklein

  • Allovertheplace
  • 13:32 (UTC -04:00)
View GitHub Profile
.evaluateTypeof()
.evaluate()
.evaluateIdentifier()
.evaluateDefinedIdentifier()
.evaluateCallExpressionMember()
.statement(statement)
.statementIf(statement)
.label()
.import(statement,source)
.importSpecifier(statement,source,exportName,identifierName)
@JeremyKruman
JeremyKruman / 2WaySplit.js
Last active December 2, 2017 15:17
Custom CSS to be used with the Custom CSS and JS Loader extension to create a horizontal and vertical split layout in Visual Studio Code
//Adds an event handler to an object
function addEvent(obj, type, fn) {
if (obj.addEventListener)
obj.addEventListener(type, fn);
else if (obj.attachEvent)
obj.attachEvent('on' + type, function () { return fn.apply(obj, [window.event]); });
};
window.onload = function () {
//Give the UI 10 seconds to load (not doing this resulted in the elements not being found).
@stereokai
stereokai / index.css
Created June 18, 2017 11:03
Trigonometry in CSS
//----------------------------------*\
// TRIGONOMETRY FUNCTIONS
//----------------------------------*/
// # Trigonometry in CSS
//
// - Through Taylor/Maclaurin polynomial representation: http://people.math.sc.edu/girardi/m142/handouts/10sTaylorPolySeries.pdf
// - Useful if you don't want to use JS.
// - With CSS Variables.
// - `calc()` can't do power (x ^ y) so I used multiplication instead.
@jarshwah
jarshwah / launch.json
Created April 23, 2017 11:28
Webpack Source Maps with vscode debugging
// debug config for running project under vscode debugger
{
"version": "0.2.0",
"configurations": [
{
"trace": true,
"name": "Chrome Debug",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8000/",
@ahtcx
ahtcx / deep-merge.js
Last active June 9, 2024 14:56
Deep-Merge JavaScript objects with ES6
// ⚠ IMPORTANT: this is old and doesn't work for many different edge cases but I'll keep it as-is for any of you want it
// ⚠ IMPORTANT: you can find more robust versions in the comments or use a library implementation such as lodash's `merge`
// Merge a `source` object to a `target` recursively
const merge = (target, source) => {
// Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties
for (const key of Object.keys(source)) {
if (source[key] instanceof Object) Object.assign(source[key], merge(target[key], source[key]))
}
@boopathi
boopathi / README.md
Last active August 28, 2023 14:35
Creating a Swift-ReactNative project

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,