Skip to content

Instantly share code, notes, and snippets.

View kennyledet's full-sized avatar

Kendrick Von Ledet kennyledet

View GitHub Profile
@MorenoMdz
MorenoMdz / batchWrapper.js
Last active July 21, 2023 10:55
Firebase Firestore batch more than 500 docs or operations
const batchWrapper = async (documentRef, action, update) => {
const batchArray = [];
batchArray.push(db.batch());
let operationCounter = 0;
let batchIndex = 0;
documentRef.forEach(doc => {
console.log('Org cleanup: deleting notifications', doc.id);
if (action === 'delete') {
batchArray[batchIndex].delete(doc.ref);
@OliverForeman
OliverForeman / .block
Last active March 29, 2023 21:41
Diamonds - d3fc WebGL
license: mit
#
sudo su -
cd /usr/local/bin
mkdir ffmpeg
cd ffmpeg
wget https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.2.1-amd64-static.tar.xz
tar xvf ffmpeg-4.2.1-amd64-static.tar.xz
@dmathewwws
dmathewwws / URLSession POST.swift
Created November 5, 2016 01:35
URLSession POST request example
private static func createUserEventData(user:SKUser, eventType:SKEventType, sticker:Sticker?) {
// server endpoint
let endpoint = "https://app.stickerkit.io/userEvent/v1/\(user.projectID)"
guard let endpointUrl = URL(string: endpoint) else {
return nil
}
//Make JSON to send to send to server
@nrollr
nrollr / MongoDB_macOS_Sierra.md
Last active April 1, 2024 16:23
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
1Password.app
Acorn.app
Actions Server.app
Adobe
Adobe Creative Cloud
Adobe Lightroom
Adobe Revel.app
Affinity Designer Trial.app
Affinity Photo Beta.app
Air Display Host.app
@jamesgpearce
jamesgpearce / dimoc.md
Last active September 22, 2017 23:34
DIMOC: Do It Myself or Callback - a simple pattern for React components

TLDR: a React component should either manage its own state, or expose a callback so that its parent can. But never both.

Sometimes our first impulse is for a component to entirely manage its own state. Consider this simple theater seating picker that has a letter for a row, and a number for a seat. Clicking the buttons to increment each value is hardly the height of user-interface design, but never mind - that's how it works:

/* @flow */
var React = require('react');

var Letter: React.ReactClass = React.createClass({
  getInitialState: function(): any {
@aorcsik
aorcsik / string-truncate.swift
Last active September 27, 2017 16:22
A little truncate function extension for the default String type
extension String {
/// Truncates the string to length number of characters and
/// appends optional trailing string if longer
func truncate(length: Int, trailing: String? = nil) -> String {
if countElements(self) > length {
return self.substringToIndex(advance(self.startIndex, length)) + (trailing ?? "")
} else {
return self
}
}
@pocketkk
pocketkk / Swift - Sort by date.swift
Created July 27, 2014 17:51
Swift - Sort objects by date field
@objc(Note)
class Note: NSManagedObject {
@NSManaged var content: String
@NSManaged var date: NSDate
@NSManaged var business: Business
@NSManaged var coldcall: ColdCall
@NSManaged var contact: Contact
}
@staltz
staltz / introrx.md
Last active June 18, 2024 06:15
The introduction to Reactive Programming you've been missing