Skip to content

Instantly share code, notes, and snippets.

View jagtesh's full-sized avatar

Jag Chadha jagtesh

View GitHub Profile
@jagtesh
jagtesh / ndxl.py
Created December 10, 2024 21:31 — forked from deckar01/ndxl.py
NitroDiffusion + One Step Refiner
import torch
from diffusers import LCMScheduler
from diffusers import DiffusionPipeline, UNet2DConditionModel
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
class TimestepShiftLCMScheduler(LCMScheduler):
def __init__(self, *args, shifted_timestep=250, **kwargs):
super().__init__(*args, **kwargs)
@jagtesh
jagtesh / iframeSnippet.html
Created April 14, 2020 21:55 — forked from sperand-io/iframeSnippet.html
Using Segment via iFrame Communication
<script>
/**
* Provides a fake analytics object that sends all calls to the parent window for processing
*/
var analytics = (function() {
var eventQueue = [];
// Send the events to the frame if it's ready.
function flush(method, args) {
while (eventQueue.length) {
@jagtesh
jagtesh / gist:5c726a94f76b9d3c549650ec7bb3173e
Created October 18, 2017 18:57 — forked from oslego/gist:f13e136ffeaa6174289a
create self-signed certificate for localhost
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@jagtesh
jagtesh / phoenix_install.sh
Last active October 21, 2016 18:44 — forked from troygnichols/run phoenix on amazon linux.sh
run phoenix on amazon linux
cd ~
# app deps
sudo yum -y install git
# erlang deps
sudo yum -y groupinstall "Development Tools"
sudo yum -y install ncurses-devel
sudo yum install -y fop
sudo yum install -y openssl-devel
@jagtesh
jagtesh / schema_convert.sh
Created May 20, 2016 15:23 — forked from shantanuo/schema_convert.sh
script to convert mysql schema to be compatible with data warehouse software
#!/bin/sh
# script to convert mysql schema to be compatible with data warehouse software
# make sure that s3cmd and maatkit utility is installed
db_name=${1:-'test'}
> /root/$db_name.txt
temppath='/mnt/data/pdump1'
host='localhost'
user='maatkit'
@jagtesh
jagtesh / gist:67e8935f11e413e3b45d
Last active August 29, 2015 14:22 — forked from aaronpowell/gist:9085724
Added the ability to use multiple modules in one file
let module = macro {
case {_
$name
import $params (,) ...
} => {
letstx $name_str = [makeValue(unwrapSyntax(#{$name}), #{here})];
return #{
angular.module($name_str, [$params (,) ...])
};
}

Ace editor component for Ember.

  • A two-way binding is set up between value and the text in the editor.
  • Configure Ace in the aceInit callback.

Template

{{ace-editor value=value aceInit=aceInit class="editor"}}
@jagtesh
jagtesh / yosemite-bluetooth-fix.sh
Last active August 29, 2015 14:15 — forked from tyilo/yosemite-bluetooth-fix.sh
Updated it for use with brew
#!/bin/bash
# Install sleepwatcher
sudo cp /usr/local/Cellar/sleepwatcher/2.2/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents/
sudo cp /usr/local/Cellar/sleepwatcher/2.2/etc/sleepwatcher/rc.* /etc/c
# Add bluetooth script to /etc/rc.wakeup (the script requires root)
sudo tee -a /etc/rc.wakeup <<EOF
kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport && sleep 3 && kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
EOF
'use strict';
var q = require('q');
/**
* Constructs a function that proxies to promiseFactory
* limiting the count of promises that can run simultaneously.
* @param promiseFactory function that returns promises.
* @param limit how many promises are allowed to be running at the same time.
* @returns function that returns a promise that eventually proxies to promiseFactory.

Running emscripten on OS X

There are a number of additional dependencies required for getting things installed on OS X. Starting with a blank slate OS X machine, this is the process it takes:

# Install Xcode Command Line Tools

# Install Homebrew
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"