Skip to content

Instantly share code, notes, and snippets.

du -h . | sort -nr | more
@dsibiski
dsibiski / webpack.config.js
Created July 27, 2015 14:51
Webpack Config - 'webpack -p' not working for JS/CSS in NPM modules
path = require('path');
webpack = require('webpack');
var config = {
context: __dirname + "/app",
entry: {
javascript: "./app.js",
html: "./index.html",
},
output: {
@dsibiski
dsibiski / gist:0c746deeb21c96b3a666
Created August 17, 2015 13:10
Pass a React Native view from JS to Obj-C
RCT_EXPORT_METHOD(doSomething:(NSNumber *)reactTag)
{
[_bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
UIView *view = viewRegistry[reactTag];
if ([view isKindOfClass:[UIView class]]) {
[view doSomething];
}
}];
}
@dsibiski
dsibiski / Spinner.js
Last active September 18, 2015 01:25
Wrap platform specific components and let the packager do the work. The packager excludes "*.ios.js" files for Android development and vice versa for iOS development.
// Spinner.ios.js
var React = require('react-native');
var {
ActivityIndicatorIOS,
} = React;
class Spinner extends React.Component {
render() {
@dsibiski
dsibiski / .cvimrc
Created June 8, 2016 13:00
cVim Config
" Settings
let barposition = "bottom"
let smoothscroll = "true"
let mapleader = " "
let defaultnewtabpage = "true"
" Mappings
map <Leader>r reloadTabUncached
map <Leader>tb :tabnew<Cr>
map <Leader>x :quit<Cr>
@dsibiski
dsibiski / restore_cocoapods_symlinks.sh
Created June 17, 2014 02:55
Restore CocoaPods Symlinks
@dsibiski
dsibiski / DistinguishedName.cs
Created October 21, 2020 02:56 — forked from davetransom/DistinguishedName.cs
Implementation of LDAP Distinguished Name parser, based on http://stackoverflow.com/a/25335936/137854. Also trims leading whitespace from attribute names and handles quoted values e.g. the `O="VeriSign, Inc."` in `CN=VeriSign Class 3 Secure Server CA - G3, OU=Terms of use at https://www.verisign.com/rpa (c)10, OU=VeriSign Trust Network, O="VeriS…
public class DistinguishedName
{
/// <summary>
/// Represents a name/value pair within a distinguished name, including the index of the part.
/// </summary>
public struct Part
{
public Part(string name, string value, int index = -1)
: this()
{