Skip to content

Instantly share code, notes, and snippets.

View sughodke's full-sized avatar

Sid Ghodke sughodke

  • San Jose, California
View GitHub Profile
@GerardBCN
GerardBCN / stock_price_autoencoding.ipynb
Created January 18, 2019 21:15
Stock market Bitcoin data compression with autoencoders
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cgutwin
cgutwin / AccountEncryption.js
Last active May 24, 2024 06:07
Two-way encryption for user data (in this case, an account password) utilizing three different values for the encryption key, with NodeJS.
/*
* Encryption for the added user accounts and passwords
*
* Reference:
* https://stackoverflow.com/a/5093422
* */
require('dotenv').config()
const CRYPTO = require('crypto')
const Encryption = require('./Encryption')

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

import {
Directive,
Output,
EventEmitter,
HostBinding,
HostListener
} from 'angular2/core.js';
@Directive({
selector: '[long-press]'
@MethodGrab
MethodGrab / README.md
Last active February 22, 2023 14:15
Jenkins NodeJS Plugin: Missing nodejs.org installers

Jenkins NodeJS Plugin: Missing nodejs.org installers

Versions

  • Ubuntu 14.04 LTS x64
  • Java 1.7
  • Jenkins 1.639
  • NodeJS plugin 0.2.1
@anvaka
anvaka / 00.Intro.md
Last active July 1, 2024 01:29
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
@zachguo
zachguo / print_cm.py
Last active May 31, 2022 17:39
Pretty print for sklearn confusion matrix
from sklearn.metrics import confusion_matrix
def print_cm(cm, labels, hide_zeroes=False, hide_diagonal=False, hide_threshold=None):
"""pretty print for confusion matrixes"""
columnwidth = max([len(x) for x in labels]+[5]) # 5 is value length
empty_cell = " " * columnwidth
# Print header
print " " + empty_cell,
for label in labels:
print "%{0}s".format(columnwidth) % label,
@philipn
philipn / gist:8659192
Created January 27, 2014 23:07
Mixin to allow limiting of fields, per-request, in django-rest-framework
class AllowFieldLimitingMixin(object):
"""
A mixin for a generic APIView that will allow the serialized fields to be
limited to a set of comma-separated values, specified via the `fields`
query parameter. This will only apply to GET requests.
"""
_serializer_class_for_fields = {}
def get_serializer_class_for_fields(self, serializer_class, fields):
fields = fields.strip().split(',')
@jnschulze
jnschulze / osx_ramdisk.sh
Last active February 5, 2024 13:48
Move Chrome, Safari and iTunes Cache to Ramdisk.
#!/bin/bash
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864`
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152`
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK
CACHEDIR="/Volumes/RamDiskCache/$USER"